Use this path when you want to create workflows from a backend service, CI job, CLI, or provisioning script. The examples assume you already created an API key in the B3OS app.

Use B3OS API keys only from trusted backend environments. Browser and mobile clients should call your backend, not B3OS directly with a long-lived key.

API workflow lifecycle
definitionschema checkvalidlive version Backend service Holds API key and workflow JSON Create draft POST /v1/workflows Validate POST /v1/workflows/validate Publish POST /v1/workflows/:id/publish Run and stream Execute, inspect, reconcile status

Setup

bash
export B3OS_API_KEY="YOUR_API_KEY"export B3OS_API_URL="https://api.b3os.org"

Minimal Workflow Definition

This workflow starts with the manual trigger and logs the value supplied at run time.

json
{ "nodes": { "root": { "type": "manual", "payload": { "inputSchema": { "type": "object", "properties": { "message": { "type": "string" } } } }, "children": ["log_message"] }, "log_message": { "type": "log", "payload": { "message": "Incoming message: {{$trigger.body.message}}" }, "children": [] } }}

Create, Validate, Publish, Run

1

Create a workflow draft

bash
curl -sS -X POST "$B3OS_API_URL/v1/workflows" \ -H "Authorization: Bearer $B3OS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "API quickstart logger", "description": "A minimal workflow created from the API.", "definition": { "nodes": { "root": { "type": "manual", "payload": { "inputSchema": { "type": "object", "properties": { "message": { "type": "string" } } } }, "children": ["log_message"] }, "log_message": { "type": "log", "payload": { "message": "Incoming message: {{$trigger.body.message}}" }, "children": [] } } } }'
2

Validate before publishing

bash
curl -sS -X POST "$B3OS_API_URL/v1/workflows/validate" \ -H "Authorization: Bearer $B3OS_API_KEY" \ -H "Content-Type: application/json" \ -d @workflow.json
3

Publish the workflow

bash
curl -sS -X POST "$B3OS_API_URL/v1/workflows/$WORKFLOW_ID/publish" \ -H "Authorization: Bearer $B3OS_API_KEY" \ -H "Content-Type: application/json" \ -d '{}'
4

Run it with input

bash
curl -sS -X POST "$B3OS_API_URL/v1/workflows/$WORKFLOW_ID/run" \ -H "Authorization: Bearer $B3OS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "payload": { "message": "Hello from the API" }, "simulate": true }'

Follow the Run

Use the run ID returned by the run request.

bash
curl -N "$B3OS_API_URL/v1/runs/$RUN_ID/stream" \ -H "Authorization: Bearer $B3OS_API_KEY"
Workflow JSON

Learn the graph shape, node IDs, payloads, children, connectors, and expressions.

Learn More
Action Testing

Inspect action schemas and run action-level tests before adding nodes.

Learn More
API Reference

Use the API pages for exact request and response schemas.

Learn More
Ask a question... ⌘I