Workflows
Run a Workflow
Trigger a multi-step Workflow by ID, pass input parameters into the first step, and receive the full run result with per-step output.
POST
/
api
/
workflows
/
{workflow_id}
/
run
Run a Workflow
curl --request POST \
--url https://api.valendata.com/api/workflows/{workflow_id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"target_url": "https://example.com/pricing"
}
}
'import requests
url = "https://api.valendata.com/api/workflows/{workflow_id}/run"
payload = { "inputs": { "target_url": "https://example.com/pricing" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: {target_url: 'https://example.com/pricing'}})
};
fetch('https://api.valendata.com/api/workflows/{workflow_id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valendata.com/api/workflows/{workflow_id}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
'target_url' => 'https://example.com/pricing'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valendata.com/api/workflows/{workflow_id}/run"
payload := strings.NewReader("{\n \"inputs\": {\n \"target_url\": \"https://example.com/pricing\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.valendata.com/api/workflows/{workflow_id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"target_url\": \"https://example.com/pricing\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valendata.com/api/workflows/{workflow_id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {\n \"target_url\": \"https://example.com/pricing\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"inputs": {},
"outputs": null,
"error": "<string>",
"credits_charged": 123,
"execution_time_ms": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"step_results": [
{
"id": "<string>",
"step_id": "<string>",
"step_name": "<string>",
"step_type": "agent",
"sequence_order": 123,
"status": "completed",
"inputs": {},
"output": null,
"error": "<string>",
"execution_time_ms": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
]
}{
"detail": "Invalid or expired API key"
}{
"detail": "Invalid or expired API key"
}{
"detail": "Invalid or expired API key"
}{
"detail": "Invalid or expired API key"
}{
"detail": "Invalid or expired API key"
}Authorizations
Session token (JWT) obtained by calling POST /api/auth/login with your email and password.
Path Parameters
The UUID of the Workflow to run.
Body
application/json
Key-value map of input parameters to pass into the first step. Reference these in step configs with {{inputs.field_name}}.
Example:
{
"target_url": "https://example.com/pricing"
}
Response
Workflow run result
Available options:
completed, failed, waiting_for_human Show child attributes
Show child attributes
⌘I
Run a Workflow
curl --request POST \
--url https://api.valendata.com/api/workflows/{workflow_id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"target_url": "https://example.com/pricing"
}
}
'import requests
url = "https://api.valendata.com/api/workflows/{workflow_id}/run"
payload = { "inputs": { "target_url": "https://example.com/pricing" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: {target_url: 'https://example.com/pricing'}})
};
fetch('https://api.valendata.com/api/workflows/{workflow_id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valendata.com/api/workflows/{workflow_id}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
'target_url' => 'https://example.com/pricing'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.valendata.com/api/workflows/{workflow_id}/run"
payload := strings.NewReader("{\n \"inputs\": {\n \"target_url\": \"https://example.com/pricing\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.valendata.com/api/workflows/{workflow_id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"target_url\": \"https://example.com/pricing\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valendata.com/api/workflows/{workflow_id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {\n \"target_url\": \"https://example.com/pricing\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"inputs": {},
"outputs": null,
"error": "<string>",
"credits_charged": 123,
"execution_time_ms": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"step_results": [
{
"id": "<string>",
"step_id": "<string>",
"step_name": "<string>",
"step_type": "agent",
"sequence_order": 123,
"status": "completed",
"inputs": {},
"output": null,
"error": "<string>",
"execution_time_ms": 123,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
]
}{
"detail": "Invalid or expired API key"
}{
"detail": "Invalid or expired API key"
}{
"detail": "Invalid or expired API key"
}{
"detail": "Invalid or expired API key"
}{
"detail": "Invalid or expired API key"
}
