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
Publish Workflow
Publish the current draft as a production workflow version
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_bodyPublishes the current draft as a new production version. This is the same action as Publish in the builder. The new version becomes active, scheduled and webhook triggers start, and the workflow is marked
Publish is rejected when the draft has a disconnected trigger, when a webhook is unauthenticated and the workspace requires webhook auth, or when the workflow is a template. Pause a live workflow with update and
ACTIVE.
Base URL
https://api.langdock.com/workflows/v1/publish
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) and editor access.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workflowId | string | Yes | UUID of the workflow. |
bumpType | string | Yes | Version bump: major, minor, or patch. |
description | string | No | Version description. Maximum: 255 characters. |
timezone | string | No | Valid IANA timezone. Stored only when a valid name is sent. |
status: "INACTIVE".
Example
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");
Response format
Success response (200 OK)
{
status: "success";
message: "Workflow published successfully";
workflow: object;
}
workflow matches the object on Workflow API Overview.
Error handling
| Status code | Description |
|---|---|
| 400 | Invalid body, disconnected trigger, webhook auth required, template workflow, or missing draft |
| 401 | Invalid or missing API key |
| 403 | Missing WORKFLOW_WRITE_API scope or editor access. A missing workflow, a template, or a workflow in another workspace also returns this status. |
| 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
Response
Workflow published successfully
Was this page helpful?