API reference
Manage workflows, jobs and public shares programmatically. Every endpoint below carries samples in four languages and a panel that sends the request for real.
The base URL is https://takiflo.runasp.net. Every sample below is generated against it, and the panels send
there unless you change the field.
Authentication
An API key is not a bearer token. You exchange it for a JWT that lasts 15 minutes, and that JWT authorises everything else. When it expires, post the key again. The key is the long-lived credential, so there is nothing else to store.
Get a key
- Sign in to TakiFlo.
- Go to API keys.
- Click Generate new key.
- Copy it. It is shown once.
Exchange it for a token
/api/apikeys/loginNo authenticationcurl -X POST https://takiflo.runasp.net/api/apikeys/login \n -H "Content-Type: application/json" \n -d '{}'{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Send it on every subsequent request:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Jobs
A job is a running instance of a workflow, holding its own copy of the graph and the state of every stage in it.
Create a job
/api/jobgraphcurl -X POST https://takiflo.runasp.net/api/jobgraph \n -H "Authorization: Bearer $TAKIFLO_JWT" \n -H "Content-Type: application/json" \n -d '{
"dagId": 45,
"name": "Customer Onboarding - Instance 1",
"jobId": 789,
"autoRepeatOnFailure": false
}'{
"id": 123,
"name": "Customer Onboarding - Instance 1",
"remainingRepeats": null,
"autoRepeatOnFailure": true,
"serialization": {
"id": 789,
"name": "Customer Onboarding - Instance 1",
"dag": { "nodes": [], "edges": [] }
}
}List jobs
/api/jobgraphcurl -X GET https://takiflo.runasp.net/api/jobgraph \n -H "Authorization: Bearer $TAKIFLO_JWT"[
{
"id": 123,
"name": "Customer Onboarding - Instance 1",
"remainingRepeats": 3,
"autoRepeatOnFailure": true
},
{
"id": 124,
"name": "Data Pipeline - Run 42",
"remainingRepeats": null,
"autoRepeatOnFailure": false
}
]Get one job
Returns the job with its full graph: every stage, its state, and the edges between them.
/api/jobgraph/:idcurl -X GET https://takiflo.runasp.net/api/jobgraph/123 \n -H "Authorization: Bearer $TAKIFLO_JWT"{
"id": 123,
"name": "Customer Onboarding - Instance 1",
"remainingRepeats": 3,
"autoRepeatOnFailure": true,
"dagId": 7,
"dagVersion": 2,
"currentDagVersion": 6,
"serialization": {
"id": 123,
"name": "Customer Onboarding - Instance 1",
"dag": {
"nodes": [
{
"id": "1",
"type": "StartNode",
"state": 2,
"name": "Start",
"description": "Kick off the onboarding"
},
{
"id": "2",
"type": "RegularNode",
"state": 1,
"name": "Collect documents",
"description": "Gather ID and proof of address",
"action": "Upload to the customer record",
"instruction": "Both documents must be dated within 3 months.",
"estimatedDuration": 3600
},
{ "id": "3", "type": "EndNode", "state": 0, "name": "End" }
],
"edges": [
{ "sourceId": 1, "targetId": 2, "logicalOperator": 0 },
{ "sourceId": 2, "targetId": 3, "logicalOperator": 0 }
]
}
}
}Errors:
| Status | Meaning |
|---|---|
404 | No job with that id. |
403 | The job belongs to another tenant. |
Delete a job
Permanently deletes it. Returns 204 No Content.
/api/jobgraph/:idcurl -X DELETE https://takiflo.runasp.net/api/jobgraph/123 \n -H "Authorization: Bearer $TAKIFLO_JWT"Moving a job along
Complete a stage
Marks a stage complete. This evaluates whatever depends on it, opens the stages that are now available, fires webhooks, and applies auto-repeat.
/api/jobgraph/Complete/Nodecurl -X POST https://takiflo.runasp.net/api/jobgraph/Complete/Node \n -H "Authorization: Bearer $TAKIFLO_JWT" \n -H "Content-Type: application/json" \n -d '{
"jobGraphId": 123,
"nodeId": 2,
"state": 2
}'// GET /api/jobgraph/123
const job = await response.json();
const stage = job.serialization.dag.nodes.find((n) => n.name === "Collect documents");
const nodeId = Number(stage.id);Undo a stage
Reverts a stage to its previous state. Real processes go backwards.
/api/jobgraph/Undo/Nodecurl -X POST https://takiflo.runasp.net/api/jobgraph/Undo/Node \n -H "Authorization: Bearer $TAKIFLO_JWT" \n -H "Content-Type: application/json" \n -d '{
"jobGraphId": 123,
"nodeId": 2
}'Reset a job
Returns a finished job to its starting state. Only works when the end stage is in a terminal state, success or failure. Optionally decrements the remaining repeats counter.
/api/jobgraph/:id/resetcurl -X POST https://takiflo.runasp.net/api/jobgraph/123/reset?decrement=true \n -H "Authorization: Bearer $TAKIFLO_JWT"{ "remainingRepeats": 2 }Stage states
Every stage in a job is in one of four states.
| Value | State | Meaning |
|---|---|---|
0 | Pending | Waiting on the stages before it. |
1 | In progress | Available to be worked on now. |
2 | Success | Completed. |
3 | Failure | Completed unsuccessfully. |
Public sharing
Share a job with someone who has no account, so a customer or a stakeholder can watch progress without being invited into your organisation.
Create a share key
/api/publicjobgraphscurl -X POST https://takiflo.runasp.net/api/publicjobgraphs \n -H "Authorization: Bearer $TAKIFLO_JWT" \n -H "Content-Type: application/json" \n -d '{
"jobGraphId": 123
}'"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"Read a shared job
No authentication. Anyone holding the key can read it, which is the point.
/api/publicjobgraphs/:keyNo authenticationcurl -X GET https://takiflo.runasp.net/api/publicjobgraphs/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6List your share keys
/api/publicjobgraphs/by-tenantcurl -X GET https://takiflo.runasp.net/api/publicjobgraphs/by-tenant \n -H "Authorization: Bearer $TAKIFLO_JWT"Revoke a share key
Removes the key. The job is no longer reachable through the public endpoint.
/api/publicjobgraphs/:idcurl -X DELETE https://takiflo.runasp.net/api/publicjobgraphs/1 \n -H "Authorization: Bearer $TAKIFLO_JWT"Need Help?
We're here to support you every step of the way.