> 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/flow-setup-essentials/designing-a-flow/flow-response-success-and-error.md).

# Flow Response: Success & Error

The **Flow Response** components control what your flow returns when it finishes. Use **Flow Response: Success** to define the payload and HTTP status code returned on a successful run, and **Flow Response: Error** to define what gets returned when the flow encounters a failure. Every API-triggered flow should include both so that callers receive meaningful feedback regardless of the outcome.

<figure><img src="https://docs.fastn.ai/~gitbook/image?url=https%3A%2F%2F1255842839-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F3iSr2Tx8FvvuoLPncziH%252Fuploads%252FDAduJicFuosyr81g6L5w%252Fimage.png%3Falt%3Dmedia%26token%3D71f42458-ebf4-4c2f-8cae-82f88ffad067&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=cb51acfb&#x26;sv=2" alt="Flow Response component with success and error message configuration fields"><figcaption></figcaption></figure>

**Example Success Definition**

```
Str Status = "success"  
Str Message = "Order processed"  
Int OrderId = 12345
```

**Example Error Definition**

```
Str Status = "error"  
Str ErrorMessage = "Invalid customer email"
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fastn.ai/flow-setup-essentials/designing-a-flow/flow-response-success-and-error.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
