curl --request POST \
--url https://inference.studio.lyzr.ai/api/workflows/execute \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"workflow_id": "wf_9f2c1a",
"workflow": {},
"input": [
{}
],
"environment": "live"
}
'import requests
url = "https://inference.studio.lyzr.ai/api/workflows/execute"
payload = {
"workflow_id": "wf_9f2c1a",
"workflow": {},
"input": [{}],
"environment": "live"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({workflow_id: 'wf_9f2c1a', workflow: {}, input: [{}], environment: 'live'})
};
fetch('https://inference.studio.lyzr.ai/api/workflows/execute', 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://inference.studio.lyzr.ai/api/workflows/execute",
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([
'workflow_id' => 'wf_9f2c1a',
'workflow' => [
],
'input' => [
[
]
],
'environment' => 'live'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://inference.studio.lyzr.ai/api/workflows/execute"
payload := strings.NewReader("{\n \"workflow_id\": \"wf_9f2c1a\",\n \"workflow\": {},\n \"input\": [\n {}\n ],\n \"environment\": \"live\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://inference.studio.lyzr.ai/api/workflows/execute")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workflow_id\": \"wf_9f2c1a\",\n \"workflow\": {},\n \"input\": [\n {}\n ],\n \"environment\": \"live\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.studio.lyzr.ai/api/workflows/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_id\": \"wf_9f2c1a\",\n \"workflow\": {},\n \"input\": [\n {}\n ],\n \"environment\": \"live\"\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "exec_5b7d3e",
"status": "running"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Execute Workflow
Submits a workflow for asynchronous execution and returns an execution_id to poll. The request accepts either a structured payload referencing a stored workflow_id (preferred) or inline workflow JSON (legacy). By default a stored workflow runs its live version, or its draft if no version has been deployed; set environment to test to run the draft. A workflow whose reachable nodes include an unknown node type, or a connection from an output a node does not have, is refused before the run starts with 400 and an error that begins “invalid workflow”. Nodes not reachable from the trigger are ignored. Authentication accepts the x-api-key header, or an X-Webhook-Secret header matching the workflow trigger’s webhookSecret, in which case the run executes as the workflow’s owner.
curl --request POST \
--url https://inference.studio.lyzr.ai/api/workflows/execute \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"workflow_id": "wf_9f2c1a",
"workflow": {},
"input": [
{}
],
"environment": "live"
}
'import requests
url = "https://inference.studio.lyzr.ai/api/workflows/execute"
payload = {
"workflow_id": "wf_9f2c1a",
"workflow": {},
"input": [{}],
"environment": "live"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({workflow_id: 'wf_9f2c1a', workflow: {}, input: [{}], environment: 'live'})
};
fetch('https://inference.studio.lyzr.ai/api/workflows/execute', 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://inference.studio.lyzr.ai/api/workflows/execute",
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([
'workflow_id' => 'wf_9f2c1a',
'workflow' => [
],
'input' => [
[
]
],
'environment' => 'live'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://inference.studio.lyzr.ai/api/workflows/execute"
payload := strings.NewReader("{\n \"workflow_id\": \"wf_9f2c1a\",\n \"workflow\": {},\n \"input\": [\n {}\n ],\n \"environment\": \"live\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://inference.studio.lyzr.ai/api/workflows/execute")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workflow_id\": \"wf_9f2c1a\",\n \"workflow\": {},\n \"input\": [\n {}\n ],\n \"environment\": \"live\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inference.studio.lyzr.ai/api/workflows/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_id\": \"wf_9f2c1a\",\n \"workflow\": {},\n \"input\": [\n {}\n ],\n \"environment\": \"live\"\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "exec_5b7d3e",
"status": "running"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}environment to test:
{"workflow_id": "wf_123", "environment": "test", "input": [{"question": "..."}]}
Authorizations
Lyzr API key. Studio session keys (agk_, ags_) and durable sk- keys are accepted. Required on every endpoint except GET /node-types and a webhook-triggered execute that carries X-Webhook-Secret.
Body
Workflow execution request
Reference to a stored workflow. Preferred over inline JSON.
"wf_9f2c1a"
Inline workflow definition (legacy). Provide either workflow_id or workflow, not both.
Trigger data passed to the workflow's entry nodes.
Show child attributes
Show child attributes
Which graph to run. live runs the deployed version, or the draft when no version has been deployed yet. test runs the current draft.
live, test Response
Execution accepted; poll GET /executions/{id} for status.