Create a workflow
curl --request POST \
--url https://api.langdock.com/workflows/v1/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"timezone": "<string>",
"nodes": [
{}
],
"edges": [
{}
],
"shareWith": {
"userIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"groupIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"role": "editor"
},
"limits": {
"monthlyCostUsd": 5000.5,
"perRunCostUsd": 50.5,
"maxExecutionsPerHour": 2500
}
}
'import requests
url = "https://api.langdock.com/workflows/v1/create"
payload = {
"name": "<string>",
"description": "<string>",
"timezone": "<string>",
"nodes": [{}],
"edges": [{}],
"shareWith": {
"userIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"groupIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"role": "editor"
},
"limits": {
"monthlyCostUsd": 5000.5,
"perRunCostUsd": 50.5,
"maxExecutionsPerHour": 2500
}
}
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({
name: '<string>',
description: '<string>',
timezone: '<string>',
nodes: [{}],
edges: [{}],
shareWith: {
userIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
groupIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
role: 'editor'
},
limits: {monthlyCostUsd: 5000.5, perRunCostUsd: 50.5, maxExecutionsPerHour: 2500}
})
};
fetch('https://api.langdock.com/workflows/v1/create', 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.langdock.com/workflows/v1/create",
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([
'name' => '<string>',
'description' => '<string>',
'timezone' => '<string>',
'nodes' => [
[
]
],
'edges' => [
[
]
],
'shareWith' => [
'userIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'groupIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'role' => 'editor'
],
'limits' => [
'monthlyCostUsd' => 5000.5,
'perRunCostUsd' => 50.5,
'maxExecutionsPerHour' => 2500
]
]),
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.langdock.com/workflows/v1/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\",\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"shareWith\": {\n \"userIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"groupIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"role\": \"editor\"\n },\n \"limits\": {\n \"monthlyCostUsd\": 5000.5,\n \"perRunCostUsd\": 50.5,\n \"maxExecutionsPerHour\": 2500\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.langdock.com/workflows/v1/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\",\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"shareWith\": {\n \"userIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"groupIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"role\": \"editor\"\n },\n \"limits\": {\n \"monthlyCostUsd\": 5000.5,\n \"perRunCostUsd\": 50.5,\n \"maxExecutionsPerHour\": 2500\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/workflows/v1/create")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\",\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"shareWith\": {\n \"userIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"groupIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"role\": \"editor\"\n },\n \"limits\": {\n \"monthlyCostUsd\": 5000.5,\n \"perRunCostUsd\": 50.5,\n \"maxExecutionsPerHour\": 2500\n }\n}"
response = http.request(request)
puts response.read_bodyWorkflow API
Create Workflow
Create an inactive draft workflow in your workspace
POST
/
workflows
/
v1
/
create
Create a workflow
curl --request POST \
--url https://api.langdock.com/workflows/v1/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"timezone": "<string>",
"nodes": [
{}
],
"edges": [
{}
],
"shareWith": {
"userIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"groupIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"role": "editor"
},
"limits": {
"monthlyCostUsd": 5000.5,
"perRunCostUsd": 50.5,
"maxExecutionsPerHour": 2500
}
}
'import requests
url = "https://api.langdock.com/workflows/v1/create"
payload = {
"name": "<string>",
"description": "<string>",
"timezone": "<string>",
"nodes": [{}],
"edges": [{}],
"shareWith": {
"userIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"groupIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"role": "editor"
},
"limits": {
"monthlyCostUsd": 5000.5,
"perRunCostUsd": 50.5,
"maxExecutionsPerHour": 2500
}
}
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({
name: '<string>',
description: '<string>',
timezone: '<string>',
nodes: [{}],
edges: [{}],
shareWith: {
userIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
groupIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
role: 'editor'
},
limits: {monthlyCostUsd: 5000.5, perRunCostUsd: 50.5, maxExecutionsPerHour: 2500}
})
};
fetch('https://api.langdock.com/workflows/v1/create', 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.langdock.com/workflows/v1/create",
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([
'name' => '<string>',
'description' => '<string>',
'timezone' => '<string>',
'nodes' => [
[
]
],
'edges' => [
[
]
],
'shareWith' => [
'userIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'groupIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'role' => 'editor'
],
'limits' => [
'monthlyCostUsd' => 5000.5,
'perRunCostUsd' => 50.5,
'maxExecutionsPerHour' => 2500
]
]),
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.langdock.com/workflows/v1/create"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\",\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"shareWith\": {\n \"userIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"groupIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"role\": \"editor\"\n },\n \"limits\": {\n \"monthlyCostUsd\": 5000.5,\n \"perRunCostUsd\": 50.5,\n \"maxExecutionsPerHour\": 2500\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.langdock.com/workflows/v1/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\",\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"shareWith\": {\n \"userIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"groupIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"role\": \"editor\"\n },\n \"limits\": {\n \"monthlyCostUsd\": 5000.5,\n \"perRunCostUsd\": 50.5,\n \"maxExecutionsPerHour\": 2500\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/workflows/v1/create")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\",\n \"nodes\": [\n {}\n ],\n \"edges\": [\n {}\n ],\n \"shareWith\": {\n \"userIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"groupIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"role\": \"editor\"\n },\n \"limits\": {\n \"monthlyCostUsd\": 5000.5,\n \"perRunCostUsd\": 50.5,\n \"maxExecutionsPerHour\": 2500\n }\n}"
response = http.request(request)
puts response.read_bodyCreates an inactive unpublished draft owned by the API key user. Creating a workflow does not publish it or start schedules and webhooks.
The graph uses the same node and edge schema as the workflow builder. Templates cannot be created through this API.
Base URL
https://api.langdock.com/workflows/v1/create
Dedicated deploymentsReplace
api.langdock.com with <your-deployment-url>/api/public in all requests.Required scopes
This endpoint requires theWORKFLOW_WRITE_API scope (Workflow Write API). The key user also needs the createWorkflows permission.
shareWith requires the shareWorkflows permission. An unknown or unshareable target fails the request with 404 and the workflow is not created.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Workflow name. Maximum: 60 characters. |
description | string | No | Workflow description. Maximum: 500 characters. |
timezone | string | No | Valid IANA timezone, for example Europe/Berlin. |
initialTriggerKind | string | No | Starter trigger: manual, webhook, scheduled, form, integration, or meeting_end (Meeting End). Do not send this together with nodes and edges. meeting_end requires Meetings for the key user. Otherwise the request returns 403 with MEETINGS_FEATURE_FLAG_DISABLED. |
nodes | array | No | Draft nodes. Must be sent together with edges. |
edges | array | No | Draft edges. Must be sent together with nodes. |
shareWith | object | No | Users and groups to share with. userIds and groupIds are UUID arrays (maximum 100 each). role is user (viewer) or editor (default editor). |
limits | object | No | Execution caps. monthlyCostUsd is 1 to 10000. perRunCostUsd is 1 to 100. maxExecutionsPerHour is 1 to 5000. Send null on a field to clear it. Omitted fields use builder defaults: 25monthly(ortheworkspacedefault),2 per run, and 100 executions per hour. |
Example
const axios = require("axios");
async function createWorkflow() {
const response = await axios.post(
"https://api.langdock.com/workflows/v1/create",
{
name: "Sync content",
description: "Synchronizes content",
timezone: "Europe/Berlin",
initialTriggerKind: "manual",
shareWith: {
userIds: ["7c9e6679-7425-40de-944b-e07fc1f90ae7"],
groupIds: [],
role: "editor"
}
},
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
}
);
console.log("Created workflow:", response.data.workflow.id);
}
createWorkflow();
Response format
Success response (200 OK)
{
status: "success";
message: "Workflow created successfully";
workflow: object;
}
workflow matches the object on Workflow API Overview. Without shareWith, only the key (and workspace admins in governance) can see the draft until it is shared.
Error handling
| Status code | Description |
|---|---|
| 400 | Invalid body, mixed initialTriggerKind with a graph, or nodes without edges |
| 401 | Invalid or missing API key |
| 403 | Missing WORKFLOW_WRITE_API scope, createWorkflows, or shareWorkflows. meeting_end without Meetings returns MEETINGS_FEATURE_FLAG_DISABLED. |
| 404 | A shareWith target is unknown or cannot be shared |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.
Authorizations
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Body
application/json
Maximum string length:
60Maximum string length:
500Valid IANA timezone.
Starter trigger. Do not send this together with nodes and edges.
Available options:
manual, webhook, scheduled, form, integration, meeting_end Draft nodes. Must be sent together with edges.
Draft edges. Must be sent together with nodes.
Show child attributes
Show child attributes
Execution caps. Send null on a field to clear it.
Show child attributes
Show child attributes
Response
Workflow created successfully
Was this page helpful?