curl --request POST \
--url https://flowker.sandbox.lerian.net/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Payment Notification Flow",
"description": "Receives a webhook trigger and sets the payment output.",
"nodes": [
{
"id": "trigger-1",
"type": "trigger",
"name": "Webhook Trigger",
"position": {
"x": 0,
"y": 0
},
"data": {
"triggerType": "webhook",
"path": "payments/received",
"method": "POST",
"input_contract": "open",
"format": "json"
}
},
{
"id": "set-output",
"type": "action",
"name": "Set Payment Output",
"position": {
"x": 200,
"y": 0
},
"data": {
"actionType": "set_output",
"output": {
"status": "received"
}
}
}
],
"edges": [
{
"id": "e1",
"source": "trigger-1",
"target": "set-output"
}
],
"metadata": {
"team": "payments",
"environment": "sandbox"
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://flowker.sandbox.lerian.net/v1/workflows"
payload := strings.NewReader("{\n \"name\": \"Payment Notification Flow\",\n \"description\": \"Receives a webhook trigger and sets the payment output.\",\n \"nodes\": [\n {\n \"id\": \"trigger-1\",\n \"type\": \"trigger\",\n \"name\": \"Webhook Trigger\",\n \"position\": {\n \"x\": 0,\n \"y\": 0\n },\n \"data\": {\n \"triggerType\": \"webhook\",\n \"path\": \"payments/received\",\n \"method\": \"POST\",\n \"input_contract\": \"open\",\n \"format\": \"json\"\n }\n },\n {\n \"id\": \"set-output\",\n \"type\": \"action\",\n \"name\": \"Set Payment Output\",\n \"position\": {\n \"x\": 200,\n \"y\": 0\n },\n \"data\": {\n \"actionType\": \"set_output\",\n \"output\": {\n \"status\": \"received\"\n }\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1\",\n \"source\": \"trigger-1\",\n \"target\": \"set-output\"\n }\n ],\n \"metadata\": {\n \"team\": \"payments\",\n \"environment\": \"sandbox\"\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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Payment Notification Flow',
description: 'Receives a webhook trigger and sets the payment output.',
nodes: [
{
id: 'trigger-1',
type: 'trigger',
name: 'Webhook Trigger',
position: {x: 0, y: 0},
data: {
triggerType: 'webhook',
path: 'payments/received',
method: 'POST',
input_contract: 'open',
format: 'json'
}
},
{
id: 'set-output',
type: 'action',
name: 'Set Payment Output',
position: {x: 200, y: 0},
data: {actionType: 'set_output', output: {status: 'received'}}
}
],
edges: [{id: 'e1', source: 'trigger-1', target: 'set-output'}],
metadata: {team: 'payments', environment: 'sandbox'}
})
};
fetch('https://flowker.sandbox.lerian.net/v1/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://flowker.sandbox.lerian.net/v1/workflows"
payload = {
"name": "Payment Notification Flow",
"description": "Receives a webhook trigger and sets the payment output.",
"nodes": [
{
"id": "trigger-1",
"type": "trigger",
"name": "Webhook Trigger",
"position": {
"x": 0,
"y": 0
},
"data": {
"triggerType": "webhook",
"path": "payments/received",
"method": "POST",
"input_contract": "open",
"format": "json"
}
},
{
"id": "set-output",
"type": "action",
"name": "Set Payment Output",
"position": {
"x": 200,
"y": 0
},
"data": {
"actionType": "set_output",
"output": { "status": "received" }
}
}
],
"edges": [
{
"id": "e1",
"source": "trigger-1",
"target": "set-output"
}
],
"metadata": {
"team": "payments",
"environment": "sandbox"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"createdAt": "2026-03-17T14:30:00Z",
"status": "draft",
"version": "1.0.0",
"workflowId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}{
"code": "FLK-0001",
"detail": "name is a required field",
"errors": [
{
"location": "body.nodes",
"message": "expected array length >= 1",
"value": "<unknown>"
}
],
"instance": "/v1/workflows",
"status": 400,
"title": "Bad Request",
"type": "https://errors.lerian.studio/v1/FLK-0001"
}{
"code": "FLK-0001",
"detail": "name is a required field",
"errors": [
{
"location": "body.nodes",
"message": "expected array length >= 1",
"value": "<unknown>"
}
],
"instance": "/v1/workflows",
"status": 400,
"title": "Bad Request",
"type": "https://errors.lerian.studio/v1/FLK-0001"
}{
"code": "FLK-0001",
"detail": "name is a required field",
"errors": [
{
"location": "body.nodes",
"message": "expected array length >= 1",
"value": "<unknown>"
}
],
"instance": "/v1/workflows",
"status": 400,
"title": "Bad Request",
"type": "https://errors.lerian.studio/v1/FLK-0001"
}{
"code": "FLK-0001",
"detail": "name is a required field",
"errors": [
{
"location": "body.nodes",
"message": "expected array length >= 1",
"value": "<unknown>"
}
],
"instance": "/v1/workflows",
"status": 400,
"title": "Bad Request",
"type": "https://errors.lerian.studio/v1/FLK-0001"
}Create a Workflow
Use this endpoint to create a new workflow definition. New workflows are created in draft status.
curl --request POST \
--url https://flowker.sandbox.lerian.net/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Payment Notification Flow",
"description": "Receives a webhook trigger and sets the payment output.",
"nodes": [
{
"id": "trigger-1",
"type": "trigger",
"name": "Webhook Trigger",
"position": {
"x": 0,
"y": 0
},
"data": {
"triggerType": "webhook",
"path": "payments/received",
"method": "POST",
"input_contract": "open",
"format": "json"
}
},
{
"id": "set-output",
"type": "action",
"name": "Set Payment Output",
"position": {
"x": 200,
"y": 0
},
"data": {
"actionType": "set_output",
"output": {
"status": "received"
}
}
}
],
"edges": [
{
"id": "e1",
"source": "trigger-1",
"target": "set-output"
}
],
"metadata": {
"team": "payments",
"environment": "sandbox"
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://flowker.sandbox.lerian.net/v1/workflows"
payload := strings.NewReader("{\n \"name\": \"Payment Notification Flow\",\n \"description\": \"Receives a webhook trigger and sets the payment output.\",\n \"nodes\": [\n {\n \"id\": \"trigger-1\",\n \"type\": \"trigger\",\n \"name\": \"Webhook Trigger\",\n \"position\": {\n \"x\": 0,\n \"y\": 0\n },\n \"data\": {\n \"triggerType\": \"webhook\",\n \"path\": \"payments/received\",\n \"method\": \"POST\",\n \"input_contract\": \"open\",\n \"format\": \"json\"\n }\n },\n {\n \"id\": \"set-output\",\n \"type\": \"action\",\n \"name\": \"Set Payment Output\",\n \"position\": {\n \"x\": 200,\n \"y\": 0\n },\n \"data\": {\n \"actionType\": \"set_output\",\n \"output\": {\n \"status\": \"received\"\n }\n }\n }\n ],\n \"edges\": [\n {\n \"id\": \"e1\",\n \"source\": \"trigger-1\",\n \"target\": \"set-output\"\n }\n ],\n \"metadata\": {\n \"team\": \"payments\",\n \"environment\": \"sandbox\"\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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Payment Notification Flow',
description: 'Receives a webhook trigger and sets the payment output.',
nodes: [
{
id: 'trigger-1',
type: 'trigger',
name: 'Webhook Trigger',
position: {x: 0, y: 0},
data: {
triggerType: 'webhook',
path: 'payments/received',
method: 'POST',
input_contract: 'open',
format: 'json'
}
},
{
id: 'set-output',
type: 'action',
name: 'Set Payment Output',
position: {x: 200, y: 0},
data: {actionType: 'set_output', output: {status: 'received'}}
}
],
edges: [{id: 'e1', source: 'trigger-1', target: 'set-output'}],
metadata: {team: 'payments', environment: 'sandbox'}
})
};
fetch('https://flowker.sandbox.lerian.net/v1/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://flowker.sandbox.lerian.net/v1/workflows"
payload = {
"name": "Payment Notification Flow",
"description": "Receives a webhook trigger and sets the payment output.",
"nodes": [
{
"id": "trigger-1",
"type": "trigger",
"name": "Webhook Trigger",
"position": {
"x": 0,
"y": 0
},
"data": {
"triggerType": "webhook",
"path": "payments/received",
"method": "POST",
"input_contract": "open",
"format": "json"
}
},
{
"id": "set-output",
"type": "action",
"name": "Set Payment Output",
"position": {
"x": 200,
"y": 0
},
"data": {
"actionType": "set_output",
"output": { "status": "received" }
}
}
],
"edges": [
{
"id": "e1",
"source": "trigger-1",
"target": "set-output"
}
],
"metadata": {
"team": "payments",
"environment": "sandbox"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"createdAt": "2026-03-17T14:30:00Z",
"status": "draft",
"version": "1.0.0",
"workflowId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}{
"code": "FLK-0001",
"detail": "name is a required field",
"errors": [
{
"location": "body.nodes",
"message": "expected array length >= 1",
"value": "<unknown>"
}
],
"instance": "/v1/workflows",
"status": 400,
"title": "Bad Request",
"type": "https://errors.lerian.studio/v1/FLK-0001"
}{
"code": "FLK-0001",
"detail": "name is a required field",
"errors": [
{
"location": "body.nodes",
"message": "expected array length >= 1",
"value": "<unknown>"
}
],
"instance": "/v1/workflows",
"status": 400,
"title": "Bad Request",
"type": "https://errors.lerian.studio/v1/FLK-0001"
}{
"code": "FLK-0001",
"detail": "name is a required field",
"errors": [
{
"location": "body.nodes",
"message": "expected array length >= 1",
"value": "<unknown>"
}
],
"instance": "/v1/workflows",
"status": 400,
"title": "Bad Request",
"type": "https://errors.lerian.studio/v1/FLK-0001"
}{
"code": "FLK-0001",
"detail": "name is a required field",
"errors": [
{
"location": "body.nodes",
"message": "expected array length >= 1",
"value": "<unknown>"
}
],
"instance": "/v1/workflows",
"status": 400,
"title": "Bad Request",
"type": "https://errors.lerian.studio/v1/FLK-0001"
}Authorizations
JWT bearer token issued by the identity provider. Send it in the Authorization header as Bearer <token>.
Body
Request body containing the workflow definition.
Unique name for the workflow.
1 - 100"Payment Notification Flow"
Optional human-readable description of the workflow's purpose.
500"Receives a webhook trigger and sets the payment output."
Connections between nodes that define the execution flow. Each edge links a source node to a target node. Branching is routed by the edge's sourceHandle, which must match the outcome handle its conditional source node produces.
200Show child attributes
Show child attributes
Custom key-value pairs for tagging or categorizing the workflow.
Show child attributes
Show child attributes
{ "team": "payments", "environment": "sandbox" }
The steps that make up this workflow. Each node is a unit of work — a trigger, an executor call, a conditional branch, or an action.
100Show child attributes
Show child attributes
Response
Indicates that the resource was successfully created and the operation was completed as expected.
Timestamp when the workflow was created.
"2026-03-17T14:30:00Z"
Initial status of the workflow (always draft on creation).
"draft"
Version of the workflow definition.
"1.0.0"
Unique identifier of the created workflow.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Was this page helpful?

