{
  "access": "public",
  "type": "tutorial",
  "format": "markdown",
  "title": "Guide Mode",
  "chunked": true,
  "url": "https://library.datagrout.ai/guide-mode",
  "summary": "**Step-by-step workflow navigation through a decision tree**",
  "content_markdown": "# Guide Mode\n\n**Step-by-step workflow navigation through a decision tree**\n\nGuide Mode walks you through building a workflow one decision at a time. You start with a natural language goal. The system presents options at each step -- which tool to use, what parameters to set, what to do with the output. You select choices by ID, and at the end you can compile the session into a reusable skill.\n\n---\n\n## Start a Session\n\n### From the Playground\n\n1. Open the Playground.\n2. Switch to **Guide** mode using the mode selector.\n3. Type your goal and press Enter.\n\n### From the Conduit SDK\n\n```python\nsession = client.guide(goal=\"export all invoices as PDF\")\n```\n\n### From the discovery.guide Tool\n\nCall `discovery.guide` directly:\n\n```json\n{\n  \"name\": \"data-grout/discovery.guide@1\",\n  \"arguments\": {\n    \"goal\": \"export all invoices as PDF\"\n  }\n}\n```\n\n---\n\n## Navigate the Decision Tree\n\nAfter you submit a goal, the system returns a message and a set of options.\n\n```\nMessage: \"Which billing system do you want to export from?\"\n\nOptions:\n  1.1  QuickBooks Online\n  1.2  Stripe\n  1.3  SAP\n```\n\nSelect an option by its ID:\n\n```python\nsession = client.guide(choice=\"1.1\")\n```\n\nThe system advances to the next step and presents new options:\n\n```\nMessage: \"What date range?\"\n\nOptions:\n  1.1.1  Last 30 days\n  1.1.2  Last quarter\n  1.1.3  Custom range\n```\n\nContinue selecting until the workflow is complete.\n\n### Choice IDs\n\nEach option has a hierarchical ID (e.g., `1.2.3`) that reflects its position in the decision tree. Use the exact ID string when selecting.\n\n### Going Back\n\nPass `back: true` to return to the previous step:\n\n```python\nsession = client.guide(back=True)\n```\n\nThe system restores the options from the parent step. Your previous selection is undone.\n\n---\n\n## Complete the Workflow\n\nWhen all decisions are made, the system shows the assembled workflow:\n\n```\nWorkflow complete:\n\n  Step 1: quickbooks@1/get_invoices@1 (last 30 days)\n  Step 2: data-grout/prism.export@1 (format: PDF)\n\nEstimated cost: 6 credits\n\nOptions:\n  - Execute now\n  - Save as skill\n  - Modify\n```\n\n### Execute\n\nRun the workflow immediately. Each step executes in sequence, and you get results and a receipt.\n\n### Save as Skill\n\nCompile the session into a reusable skill. The system validates the workflow (type safety, policy compliance, credential availability) and, if it passes, mints a Cognitive Trust Certificate and saves the skill.\n\n```python\nskill = client.guide(save_as_skill=True, skill_name=\"monthly_invoice_export\")\n```\n\nIf validation fails, you get a structured response explaining what went wrong. No broken skill is created.\n\nOnce saved, the skill appears as a callable tool:\n\n```python\nresult = client.call_tool(\"skills@1/monthly_invoice_export@1\", {})\n```\n\nSee [Cognitive Trust Certificates](cognitive-trust-certificates) for how verification works.\n\n---\n\n## When to Use Guide Mode\n\nGuide Mode is most useful when you:\n\n- **Explore an unfamiliar integration** and want to see what is available step by step.\n- **Build a workflow interactively** rather than writing the full plan upfront.\n- **Want to save a verified workflow** as a skill for repeated use.\n- **Need to understand the decision points** in a complex multi-step process.\n\nFor known workflows where you already have the full plan, use `flow.into` directly. For single-step tool calls, use `discovery.perform` or `call_tool`.\n\n---\n\n## Example: Invoice Export\n\n```\nYou: \"Export last month's invoices from QuickBooks as CSV\"\n\nSystem: \"I found QuickBooks on your server. Which invoice filter?\"\n  1.1  All invoices from last month\n  1.2  Only paid invoices\n  1.3  Only overdue invoices\n\nYou: 1.1\n\nSystem: \"Export format confirmed as CSV. Include line items?\"\n  1.1.1  Yes, include line items\n  1.1.2  No, summary only\n\nYou: 1.1.1\n\nSystem: \"Workflow ready.\"\n  Step 1: quickbooks@1/get_invoices@1 (filter: last month)\n  Step 2: data-grout/prism.export@1 (format: CSV, include line items)\n  Estimated cost: 5 credits\n\n  [Execute] [Save as skill]\n```\n\n---\n\n## Related\n\n- [Playground Guide](playground-guide) -- Full Playground walkthrough including Guide Mode\n- [Cognitive Trust Certificates](cognitive-trust-certificates) -- How skill verification works\n- [Conduit SDK](conduit-sdk) -- Using `guide()` programmatically\n"
}