Self-generating workflows
Ploton does not use DAGs. No workflow definition language, no step builder, no drag-and-drop canvas.
When your agent routes a task to a subagent, the subagent analyzes the prompt, selects tools from its domain, checks past execution context, and generates a workflow at runtime. The workflow is a sequence of steps, but it’s not fixed — if a step fails, the subagent adapts the plan. If new requirements surface mid-execution, it adds steps.
flowchart LR
A[Task + sub_agent] --> B[Route to subagent]
B --> C[Select tools]
C --> D[Check training]
D --> E[Generate steps]
E --> F{Execute step}
F -->|Success| G{More steps?}
G -->|Yes| F
G -->|No| H[Result]
F -->|Failure| I[Adapt & recover]
I --> F
Scripts follow a plan. This responds to what actually happens.
How it works
Take this task prompt:
Connect to user_123's team chat, find the #engineering channel,
and post a summary of their latest invoice from the payment service.The task routes to a subagent that has access to both payment and chat tools. The subagent decomposes this into a workflow:
1. [Payment] Authenticate with user_123's payment account
2. [Payment] Fetch the latest invoice
3. [Payment] Extract invoice summary (amount, date, line items)
4. [Chat] Authenticate with user_123's team chat workspace
5. [Chat] Look up the #engineering channel ID
6. [Chat] Post the invoice summary as a formatted messageThis was generated from the prompt, not predefined. The subagent used its training from the payment service and the chat platform to determine the specific steps.
When things go wrong
Say step 4 fails because the chat service OAuth token expired. In a rigid DAG, that’s a crash. Here’s what the subagent does instead:
4. [Chat] Authenticate → token expired
↳ [Chat] Trigger token refresh
↳ [Chat] Refresh succeeded → resume at step 5
5. [Chat] Look up #engineering channel → success
6. [Chat] Post message → successThe subagent’s execution memory knew that token refresh is the right recovery here. Nobody wrote a retry handler for it — this was learned from previous task runs.
When new requirements surface
Sometimes mid-execution, the subagent discovers the task needs something that wasn’t in the original plan. If the invoice is in a different currency than the user’s locale, the subagent might add a conversion step:
3a. [Utility] Convert EUR amount to USD using current exchange rateThe plan adjusts as the task runs.
Workflow visibility
Every workflow execution produces a trace — a record of what happened, in what order, and how long each step took. Available through the API and the dashboard.
curl https://api.ploton.ai/v1/tasks/task_8xK2mP/trace \
-H "Authorization: Bearer $PLOTON_API_KEY"{
"task_id": "task_8xK2mP",
"sub_agent": "billing-agent",
"steps": [
{
"tool": "payments",
"action": "authenticate",
"status": "complete",
"duration_ms": 120
},
{
"tool": "payments",
"action": "fetch_invoice",
"status": "complete",
"duration_ms": 340
},
{
"tool": "chat",
"action": "authenticate",
"status": "complete",
"duration_ms": 95,
"note": "Token refreshed automatically"
},
{
"tool": "chat",
"action": "post_message",
"status": "complete",
"duration_ms": 210
}
],
"total_duration_ms": 765
}When a task fails, the trace shows you which step broke and why.
Workflow constraints
A few things worth knowing:
- Step ordering respects data dependencies — the subagent won’t try to post a message before fetching the data to put in it.
- If two steps are independent (say, fetching invoice data and looking up a channel ID), the subagent may run them concurrently.
- Workflows are capped at 50 steps to prevent runaway execution. Tasks that would exceed this fail with a
workflow_depth_exceedederror.
Next steps
- Webhooks — how task results and progress updates get delivered
- Agents — how your AI agent fits into this picture
- Subagents — how subagents use workflows
- Trained Tasks — how execution memory powers each workflow step