Sequential Thinking
Describe a task in plain language and let Tolky plan the steps and run them with the platform's actions.
Sequential Thinking turns a request in plain language into a plan and runs it. You write what you want, for example "look up our return policy in the knowledge base and summarize it for this customer", and the engine:
Plans
Runs
Answers
Actions include searching the knowledge base, reading conversation data, capturing data into forms, interpreting dates and sending messages. List them before you start to see what the engine can do.
Send options.dryRun: true to see the plan the engine would follow, without executing any step.
ReferenceTechnical details
List actions
GET /api/externalAPIs/public/sequentialThinking/listActions. No body.
curl "https://api.tolky.to/api/externalAPIs/public/sequentialThinking/listActions" \
-H "Authorization: Bearer $TOLKY_TOKEN"{
"code": 200,
"message": "OK",
"data": {
"actions": [
{
"name": "ragSearch",
"description": "...",
"params": { },
"costControl": { "timeoutMs": 30000, "retryPolicy": { "maxAttempts": 3, "onExhausted": "abort" }, "usesLlmForParams": true }
}
],
"costControl": {
"defaultMaxSteps": 15,
"defaultStepTimeoutMs": 30000,
"costModel": { "planningLlmCalls": 1, "executionLlmCallsPerStep": 1, "estimatedTotalLlmCallsFormula": "1 + stepCount" }
}
}
}| Field | Description |
|---|---|
actions[].name | Action name, as it appears in plans. |
actions[].description | What the action does and when the planner uses it (in Portuguese). |
actions[].params | Parameters the engine fills for the action. |
actions[].costControl | Timeout and retry policy of the action. |
costControl | Defaults of a run and how to estimate AI calls: one for planning plus one per step. |
Run
POST /api/externalAPIs/public/sequentialThinking/runWithAgents with a host token (Authorization: Bearer $TOLKY_TOKEN). The call waits until the run ends.
| Name | Type | Required | Description |
|---|---|---|---|
instructions | string | Yes | What the engine should do, in plain language. |
conversationId | string | No | Conversation that gives context to the run. |
options.dryRun | boolean | No | Only plan. Steps come back with status: "planned". |
options.maxSteps | integer | No | Maximum number of planned steps. Default 15. |
curl -X POST "https://api.tolky.to/api/externalAPIs/public/sequentialThinking/runWithAgents" \
-H "Authorization: Bearer $TOLKY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"instructions": "Look up our return policy in the knowledge base and summarize it for this customer.",
"conversationId": "3f0c2a8e-...",
"options": { "maxSteps": 5 }
}'{
"code": 200,
"message": "OK",
"data": {
"result": {
"success": true,
"interrupted": false,
"intentId": "3f0c2a8e-...",
"finalAnswer": { "message": "You can return any product within 30 days: ..." },
"steps": [],
"error": null
},
"events": []
}
}| Field | Description |
|---|---|
result.success | true when the plan ran to the end. |
result.interrupted | true when the run stopped to wait for more input. |
result.intentId | ID of this run. |
result.finalAnswer.message | Final answer, always filled, also on failure. |
result.steps | Each executed step with its action, status and result. |
result.error | null, or what went wrong. |
events | Progress events emitted during the run, in order. |
Errors
A missing instructions and unexpected failures answer HTTP 500 with the reason in message. A plan that fails while running still answers 200, with result.success: false.