---
title: ToolRouter — Agent Use Case Guide
description: Step-by-step guide for completing a task with a specific AI agent using ToolRouter.
url: https://toolrouter.com/tools/diagram-generator/use-cases/generate-flowcharts/copilot
---
# How to Generate Flowcharts with Copilot

Copilot generates flowcharts from within your IDE, making it natural to document complex conditional logic alongside the code that implements it. Visualize CI/CD pipelines, authentication flows, and business logic for pull request descriptions without switching to a separate diagramming tool.

## Setup

{"mcpServers":{"toolrouter":{"command":"npx","args":["-y","toolrouter-mcp"]}}}

## Steps

1. Add ToolRouter to Copilot MCP config
2. In Copilot Chat: "Create a flowchart for this process" and describe the logic
3. Copilot generates the flowchart diagram
4. Ask: "Save this to docs/flowcharts/ in the project"

## Example Prompt

```
Generate a flowchart showing the CI/CD pipeline: push to main, run tests, if tests fail notify Slack, if tests pass build Docker image, deploy to staging, run smoke tests, if pass deploy to production.
```

## Tips

- Copilot can read existing code logic and generate a flowchart from it
- Great for documenting complex conditional logic in pull request descriptions
