Responses are the terminal steps in ServFlow workflows that define what data is returned to API clients. Every workflow path must eventually reach a response node, which specifies the HTTP status code and the structure of the JSON body sent back to the caller. While actions perform operations and conditionals make decisions, responses complete the request-response cycle by packaging results into a properly formatted HTTP response.Documentation Index
Fetch the complete documentation index at: https://docs.servflow.io/llms.txt
Use this file to discover all available pages before exploring further.
Adding a Response to Your Workflow
To add a response to your workflow in the ServFlow dashboard:- Click the + button below an existing node in the workflow canvas
- Select Response from the node type options
- The response node will be added to your workflow

Response Configuration
Selecting a response node opens the configuration panel on the left side of the screen. The panel contains two main sections:- Response Code — The HTTP status code to return
- Response Structure — The shape of the JSON response body
Response Code
The Response Code field specifies the HTTP status code that will be associated with this response. Common codes include:200(OK) — Successful request201(Created) — Resource successfully created400(Bad Request) — Validation or input errors404(Not Found) — Resource doesn’t exist500(Server Error) — Unexpected server failure
Response Structure
The Response Structure section lets you define the shape of your response object using a visual builder. You can create flat objects with simple key-value pairs or deeply nested structures.
Field Types
Each field in your response structure has a Type that determines how it behaves:| Type | Description |
|---|---|
| Object | A nested JSON object containing additional fields |
| Value | A leaf field with a static or dynamic value |
Adding Fields
Click + Add field to add a new field to your response structure. Each field requires:- Key — The JSON property name
- Type — Either Object (for nesting) or Value (for leaf values)
- Value (for Value type) — The content to return, which can include dynamic template expressions

Creating Nested Objects
To create nested JSON structures:- Add a field and set its Type to Object
- Click the expand arrow to reveal the nested field editor
- Add child fields inside the object
- Continue nesting as deeply as needed
HTTP Status Codes
Choosing the right HTTP status code helps API consumers understand the result of their request. Here are the most common codes and when to use them:Success Codes (2xx)
| Code | Name | When to Use |
|---|---|---|
200 | OK | Successful GET, PUT, or PATCH requests |
201 | Created | Successful POST that creates a new resource |
204 | No Content | Successful DELETE with no response body |
Client Error Codes (4xx)
| Code | Name | When to Use |
|---|---|---|
400 | Bad Request | Validation errors or malformed input |
401 | Unauthorized | Authentication required or invalid credentials |
403 | Forbidden | Authenticated but lacking permission |
404 | Not Found | Requested resource doesn’t exist |
409 | Conflict | Resource already exists (e.g., duplicate email) |
Server Error Codes (5xx)
| Code | Name | When to Use |
|---|---|---|
500 | Internal Server Error | Unexpected server failures |
Advanced: YAML Configuration
ServFlow APIs can also be defined using YAML configuration files. This approach is useful for version control, CI/CD pipelines, or programmatic configuration generation.Response Structure in YAML
Every response follows this structure:Common Fields
| Field | Type | Required | Description |
|---|---|---|---|
code | integer | Yes | HTTP status code (100-599) |
responseObject | object | Yes | Structured response object definition |
responseObject.fields | map | Yes | Map of field names to field definitions |
Field Definition
Each field in thefields map can have:
| Field | Type | Description |
|---|---|---|
value | string | The value for this field (can include templates) |
fields | map | Nested field definitions (creates a JSON object) |
A field should have either
value or fields, not both. Use value for leaf values and fields for nested objects.Nested Objects in YAML
Create nested JSON structures by usingfields instead of value:
Type Coercion
Values inresponseObject are automatically converted to appropriate JSON types:
| Value | Output Type |
|---|---|
"true" / "false" | Boolean |
Numeric strings ("123", "45.67") | Number |
| Template returning array/object | Array/Object |
| Other strings | String |
Accessing Data in Responses
Responses can include dynamic content from anywhere in your workflow using template syntax.Action Results
Access results from previous actions using the action ID with a dot prefix:Request Parameters
Access original request data with theparam function:
Validation Errors
When using validation functions in conditionals, errors are collected in the.errors variable:
Error Information
When an action fails and routes to a response via itsfail path, access error details with .error:
Common Response Patterns
Success Response with Data
Resource Created Response
Validation Error Response
Not Found Response
Unauthorized Response
Next Steps
Actions
Learn about actions — the building blocks of workflows.
Conditionals
Add branching logic to your workflows.
Dynamic Content
Use template syntax to create dynamic values.
Configuration Reference
See the complete ServFlow configuration options.