> ## Documentation Index
> Fetch the complete documentation index at: https://incredible-42686482-cursor-create-detailed-ai-agent-cookboo.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced Workflow

> A complex multi-tool agent workflow from the Cookbook

This example mirrors the advanced workflow in our Cookbook.

Steps covered:

* Tool planning and selection
* Multi-step execution with intermediate state
* Error handling and retries

Open the linked file for the full runnable script.

### Kickoff request (pattern)

```bash
curl -X POST "https://api.incredible.one/v1/chat-completion" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $INCREDIBLE_API_KEY" \
  -d '{
    "model": "small-1",
    "stream": false,
    "messages": [
      {"role": "user", "content": "Research and draft a brief report; use tools as needed."}
    ],
    "functions": [/* planner, fetch, analyze, format tools */]
  }'
```

The assistant will orchestrate multiple tools in sequence; send back `function_call_result` blocks as each step completes.

<Note>
  View source on GitHub → [4\_advanced\_workflow.py](https://github.com/Norditech-AB/Incredible-API-Cookbook/blob/main/02-function-calling/4_advanced_workflow.py)
</Note>
