Skip to main content

Using the Workflows API

Workflows are a first-class /v1 resource. Everything you can do in the builder — create, update, run, inspect, and cancel — is available over the API with your tenant API key, using KnoxCall’s standard response envelope, pagination, idempotency, and scopes.

Authentication & Scopes

Authenticate with a bearer API key. The key’s mode (Live/Test) scopes every response. Access is governed by workflow scopes: Read-only keys can list and read; invoke keys can additionally execute; editor/member keys can manage. A key without the required scope gets 403.

Response Envelope

Every response is wrapped:
List endpoints paginate with page and per_page query parameters and return pagination in meta:

Endpoints

Create a workflow

The definition is a graph with a nodes array containing exactly one trigger node and an edges array. It’s validated (structure + reachable trigger) on write.
Returns 201 with the created workflow (version: 1). An invalid graph returns 422.

Execute a workflow (idempotent)

The run is queued asynchronously and the call returns 201 immediately:
Send the same X-Idempotency-Key again and you get the same execution back, with an X-Idempotent-Replay: true response header — a safe retry never starts a second run.

Inspect executions

List a workflow’s runs (the polling source for automation platforms):
Get a single run with composed step details:
An execution’s status is one of queued, running, waiting, paused, completed, failed, cancelled, or timed_out. Step inputs/outputs are redacted — secret values appear as [REDACTED].

Cancel a run

Cancellation aborts in-flight work (including outbound HTTP), not just a flag.

Webhook Events

Rather than polling, subscribe an outbound webhook to run-completion events: These give automation platforms (Zapier, Make, n8n) an instant trigger on run completion. Configure them like any other webhook; payloads are signed and delivered through the same hardened egress.

SDKs, Postman & OpenAPI

The workflows resource is available in the KnoxCall SDKs (workflows.list / get / create / update / delete / execute / listExecutions / getExecution / cancelExecution), in the Postman collection (Workflows folder), and in the OpenAPI spec. The SDK methods return the same { data, meta } envelope and support the idempotency key on create / execute.

Next Steps

Triggers

Webhook and app-event triggers

Webhooks

Get notified when runs finish