Publish a workflow
curl --request POST \
--url https://api.langdock.com/workflows/v1/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"timezone": "<string>"
}
'import requests
url = "https://api.langdock.com/workflows/v1/publish"
payload = {
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"timezone": "<string>"
}
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({
workflowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
timezone: '<string>'
})
};
fetch('https://api.langdock.com/workflows/v1/publish', 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/publish",
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([
'workflowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'timezone' => '<string>'
]),
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/publish"
payload := strings.NewReader("{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\"\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/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/workflows/v1/publish")
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 \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyWorkflow API
Workflow veröffentlichen
Veröffentliche den aktuellen Entwurf als Produktionsversion
POST
/
workflows
/
v1
/
publish
Publish a workflow
curl --request POST \
--url https://api.langdock.com/workflows/v1/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"timezone": "<string>"
}
'import requests
url = "https://api.langdock.com/workflows/v1/publish"
payload = {
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"timezone": "<string>"
}
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({
workflowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
timezone: '<string>'
})
};
fetch('https://api.langdock.com/workflows/v1/publish', 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/publish",
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([
'workflowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'timezone' => '<string>'
]),
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/publish"
payload := strings.NewReader("{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\"\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/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/workflows/v1/publish")
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 \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyVeröffentlicht den aktuellen Entwurf als neue Produktionsversion. Das ist dieselbe Aktion wie Veröffentlichen im Builder. Die neue Version wird aktiv, geplante Trigger und Webhook-Trigger starten, und der Workflow wird auf
Veröffentlichen wird abgelehnt, wenn der Entwurf einen getrennten Trigger hat, wenn ein Webhook unauthentifiziert ist und der Workspace Webhook-Auth verlangt, oder wenn der Workflow eine Vorlage ist. Pausiere einen laufenden Workflow mit Aktualisieren und
ACTIVE gesetzt.
Basis-URL
https://api.langdock.com/workflows/v1/publish
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) und Bearbeiterzugriff.
Parameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workflowId | string | Ja | UUID des Workflows. |
bumpType | string | Ja | Versionserhöhung: major, minor oder patch. |
description | string | Nein | Versionsbeschreibung. Maximum: 255 Zeichen. |
timezone | string | Nein | Gültige IANA-Zeitzone. Wird nur gespeichert, wenn ein gültiger Name gesendet wird. |
status: "INACTIVE".
Beispiel
const axios = require("axios");
async function publishWorkflow(workflowId) {
const response = await axios.post(
"https://api.langdock.com/workflows/v1/publish",
{
workflowId,
bumpType: "patch",
description: "Initial production version"
},
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
}
);
console.log("Published version:", response.data.workflow.activeVersion?.version);
}
publishWorkflow("550e8400-e29b-41d4-a716-446655440000");
Antwortformat
Erfolgreiche Antwort (200 OK)
{
status: "success";
message: "Workflow published successfully";
workflow: object;
}
workflow entspricht dem Objekt in der Workflow API Übersicht.
Fehlerbehandlung
| Statuscode | Beschreibung |
|---|---|
| 400 | Ungültiger Body, getrennter Trigger, Webhook-Auth erforderlich, Vorlage oder fehlender Entwurf |
| 401 | Ungültiger oder fehlender API-Key |
| 403 | Fehlender WORKFLOW_WRITE_API Scope oder Bearbeiterzugriff. Ein fehlender Workflow, eine Vorlage oder ein Workflow in einem anderen Workspace gibt denselben Status zurück. |
| 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
Antwort
Workflow published successfully
War diese Seite hilfreich?