Building Workflows
Create multi-step integrations across your tools
This guide covers how to build workflows that span multiple integrations – from simple queries to multi-step pipelines with type bridging and approval gates.
Simple Query
The fastest way to call a tool:
Playground
Type a goal and the system finds and executes the right tool:
You: Show me my Salesforce leads
System: [discovers salesforce@1/get_leads@1, executes, shows results]
Conduit SDK
result = client.perform("salesforce@1/get_leads@1", {"limit": 10})
Sandbox
Open the integration’s detail page, go to the Sandbox tab, select the tool, fill in parameters, and click Run.
Multi-Step Workflow
When your goal involves multiple systems, the planning engine chains tools automatically.
Via Playground
You: Create QuickBooks invoices for qualified Salesforce leads
The system builds a plan:
-
salesforce@1/get_leads@1(filter: status = Qualified) -
data-grout@1/prism.focus@1(convert lead to customer) -
quickbooks@1/create_invoice@1
Review the plan and approve to execute. Each step runs in sequence, with type bridging handled automatically.
Via the API
Use discovery.plan to generate a verified plan, then flow.into to execute it:
plan = client.call_tool("data-grout@1/discovery.plan@1", {
"goal": "Create invoices from qualified leads"
})
result = client.call_tool("data-grout@1/flow.into@1", {
"plan": plan["steps"],
"save_as_skill": True,
"name": "lead_to_invoice"
})
The plan comes with a Cognitive Trust Certificate proving it is cycle-free, type-safe, and policy-compliant before any tool runs.
Type Bridging
When tools produce data in one format and the next tool expects another, the planner inserts prism.focus to convert between types:
salesforce@1/get_leads@1 → crm.lead@1
↓ prism.focus (crm.lead@1 → billing.customer@1)
quickbooks@1/create_invoice@1 ← billing.customer@1
This happens automatically during planning. You can also call prism.focus directly:
customer = client.call_tool("data-grout@1/prism.focus@1", {
"data": lead,
"source_type": "crm.lead@1",
"target_type": "billing.customer@1"
})
Approval Gates
For operations that modify data, insert an approval gate:
approval = client.call_tool("data-grout@1/flow.request-approval@1", {
"action": "Create 25 invoices in QuickBooks",
"details": {"total_amount": 47500, "count": 25},
"reason": "Bulk invoice creation"
})
if approval["decision"] == "approved":
# proceed with execution
Approval gates pause the workflow until a human responds. Configure which operations require approval in your Policy settings.
Saving Skills
After a successful workflow, save it as a reusable skill:
result = client.call_tool("data-grout@1/flow.into@1", {
"plan": [...],
"save_as_skill": True,
"name": "lead_to_invoice"
})
Skills retain their CTC and execute without re-verification on subsequent runs:
result = client.perform("skills@1/lead_to_invoice@1", {})
Error Handling
When a tool call fails, the response includes a structured error:
{
"error": {
"code": "upstream_error",
"message": "QuickBooks API rate limit exceeded"
}
}
Common error codes: tool_not_found, invalid_arguments, upstream_error, timeout, rate_limit, policy_violation.
Check the Runs tab for detailed execution logs, or use the Agent Inspector for cognitive-level debugging.
Related
- Discovery Tools – Plan and discover tools programmatically
- Flow and Inspect Tools – Workflow orchestration reference
- Cognitive Trust Certificates – How plan verification works
- Using the Playground – Interactive workflow building