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
Workflow erstellen
Erstelle einen inaktiven Workflow-Entwurf in deinem 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_bodyErstellt einen inaktiven, unveröffentlichten Entwurf, der dem API-Key-User gehört. Das Erstellen veröffentlicht den Workflow nicht und startet keine Zeitpläne oder Webhooks.
Der Graph nutzt dasselbe Node- und Kanten-Schema wie der Workflow-Builder. Vorlagen kannst du über diese API nicht erstellen.
Basis-URL
https://api.langdock.com/workflows/v1/create
Dedicated DeploymentsErsetze
api.langdock.com durch <your-deployment-url>/api/public in allen Anfragen.Erforderliche Scopes
Dieser Endpoint erfordert denWORKFLOW_WRITE_API Scope (Workflow-Schreib-API). Der Key-User braucht außerdem die Berechtigung createWorkflows.
shareWith erfordert die Berechtigung shareWorkflows. Ein unbekanntes oder nicht teilbares Ziel bricht die Anfrage mit 404 ab, und der Workflow wird nicht erstellt.Parameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
name | string | Ja | Workflow-Name. Maximum: 60 Zeichen. |
description | string | Nein | Workflow-Beschreibung. Maximum: 500 Zeichen. |
timezone | string | Nein | Gültige IANA-Zeitzone, zum Beispiel Europe/Berlin. |
initialTriggerKind | string | Nein | Starter-Trigger: manual, webhook, scheduled, form, integration oder meeting_end (Meeting End). Nicht zusammen mit nodes und edges senden. meeting_end braucht Meetings für den Key-User. Sonst kommt 403 mit MEETINGS_FEATURE_FLAG_DISABLED. |
nodes | array | Nein | Entwurf-Nodes. Muss zusammen mit edges gesendet werden. |
edges | array | Nein | Entwurf-Kanten. Muss zusammen mit nodes gesendet werden. |
shareWith | object | Nein | User und Gruppen zum Teilen. userIds und groupIds sind UUID-Arrays (jeweils maximal 100). role ist user (Betrachter) oder editor (Standard editor). |
limits | object | Nein | Ausführungslimits. monthlyCostUsd ist 1 bis 10000. perRunCostUsd ist 1 bis 100. maxExecutionsPerHour ist 1 bis 5000. Sende null auf einem Feld, um es zu leeren. Weggelassene Felder nutzen die Builder-Standards: 25 USD monatlich (oder den Workspace-Standard), 2 USD pro Ausführung und 100 Ausführungen pro Stunde. |
Beispiel
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();
Antwortformat
Erfolgreiche Antwort (200 OK)
{
status: "success";
message: "Workflow created successfully";
workflow: object;
}
workflow entspricht dem Objekt in der Workflow API Übersicht. Ohne shareWith sieht nur der Key (und Workspace-Admins in der Governance) den Entwurf, bis er geteilt wird.
Fehlerbehandlung
| Statuscode | Beschreibung |
|---|---|
| 400 | Ungültiger Body, initialTriggerKind zusammen mit einem Graphen, oder nodes ohne edges |
| 401 | Ungültiger oder fehlender API-Key |
| 403 | Fehlender WORKFLOW_WRITE_API Scope, createWorkflows oder shareWorkflows. meeting_end ohne Meetings gibt MEETINGS_FEATURE_FLAG_DISABLED zurück. |
| 404 | Ein shareWith-Ziel ist unbekannt oder nicht teilbar |
| 429 | Rate Limit überschritten |
| 500 | Interner Serverfehler |
Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu Best Practices für API-Schlüssel.
Autorisierungen
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.
Verfügbare Optionen:
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
Antwort
Workflow created successfully
War diese Seite hilfreich?