> For the complete documentation index, see [llms.txt](https://docs.fastn.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastn.ai/build/building-from-your-ai-agent.md).

# Building from your AI agent

What your own AI agent does after you ask it for an integration, where the result lands in fastn, and how to test it.

Once fastn is connected to your agent through the [MCP gateway](/build/mcp-gateway.md), you can ask for an integration in the chat. Whichever agent you use, it follows fastn's integration builder through the same six steps, and each one ends with something you approve.

| Step                                          | What the agent does                                                                 | What you do                                                                            |
| --------------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| 1. Understand                                 | Checks who you are and what's already in your workspace                             | Approve the read-only fastn calls                                                      |
| 2. Plan                                       | Picks the connectors and recommends a plan                                          | Answer its business questions; the recommendation is pre-selected                      |
| 3. Map (only when data moves between systems) | Proposes field mappings and filters                                                 | Approve them on the review page it links to                                            |
| 4. Test cases                                 | Writes acceptance tests for the whole integration                                   | Approve them on the review page; this is the go-ahead to build                         |
| 5. Build                                      | Builds, tests and publishes each workflow, sets its trigger, and creates one widget | Confirm how often it runs, and any test that writes more than a couple of live records |
| 6. Verify                                     | Runs the approved tests and checks real runs                                        | Read its report: what's running, what passed, what's left                              |

If an account isn't connected yet, the agent stops and sends a connect link. Enter credentials there, never in the chat.

This is the same idea as fastn's in-app [Agent](/build/agent.md), run from the agent you already use.

### Where the result lands in fastn

| What                    | Where                                                |
| ----------------------- | ---------------------------------------------------- |
| The workflows           | **Workflows**                                        |
| Tests and their results | Open the workflow → **Test cases**                   |
| Every run               | Open the workflow → **Executions**                   |
| What your customers see | **Widgets** → the new widget (style, embed, publish) |

### Test it

Test from your agent or from your widget, not from the workflow editor.

* **From the agent:** ask in the same chat, for example *"Run all the test cases for the invoice integration and tell me what passed."* It runs every approved test case and reports back.
* **From the widget:** connect a test account in your widget and let the integration run, the way your customers will use it.

Each run then shows under the workflow's **Executions**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fastn.ai/build/building-from-your-ai-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
