Trigger a workflow run
POST
/v1/workflows/{key}/trigger
const url = 'https://your-notavia-host/v1/workflows/example/trigger';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"trigger_data":{"invoice_id":"inv_42","amount_cents":9900,"user":{"external_user_id":"usr_1","email":"alice@example.com","phone":"+15005550006","name":"Alice"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-notavia-host/v1/workflows/example/trigger \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "trigger_data": { "invoice_id": "inv_42", "amount_cents": 9900, "user": { "external_user_id": "usr_1", "email": "alice@example.com", "phone": "+15005550006", "name": "Alice" } } }'Creates a new WorkflowRun and enqueues the first step for
execution. Idempotent when an Idempotency-Key header is supplied —
re-sending the same key within 24 hours returns the original run
without re-triggering.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” key
required
string
Workflow key — lowercase alphanumeric + underscore, max 100 chars.
Header Parameters
Section titled “Header Parameters ” Idempotency-Key
string
Client-generated key (UUID recommended). Repeat requests with the same key within 24 hours return the original response without re-sending.
Request Body required
Section titled “Request Body required ” Media type application/json
object
trigger_data
required
Arbitrary JSON object passed as the run’s trigger payload.
object
key
additional properties
any
Example
{ "trigger_data": { "invoice_id": "inv_42", "amount_cents": 9900, "user": { "external_user_id": "usr_1", "email": "alice@example.com", "phone": "+15005550006", "name": "Alice" } }}Responses
Section titled “ Responses ”Idempotent replay — existing run returned.
Media type application/json
object
run_id
required
string format: uuid
status
required
string
Example
{ "status": "pending"}Run created and first step enqueued.
Media type application/json
object
run_id
required
string format: uuid
status
required
string
Example
{ "status": "pending"}Validation or request error.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Missing or invalid credentials.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Credentials do not have the required scope.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Resource not found.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Trigger data failed trigger_data_schema validation.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}