API Output Component
Use the API Output component to structure and standardize the final output of a workflow. It's especially powerful when used as the final step in an Agent Skill, ensuring that any workflow acting as an API endpoint returns a clean, predictable, and well-formed JSON response.
What You’ll Configure
- Define Output Fields
- Select an Output Format
- Handle the Final Output
- Best Practices
- Troubleshooting Tips
- What to Try Next
Step 1: Define the Output Fields (Inputs)
The "inputs" of this component are actually the fields you want to include in your final JSON output object. For each key-value pair you want in the response, you will add one input.
Field | Required? | Description |
---|---|---|
Name | Yes | The key name for the field in the final JSON output (e.g., data ). |
Type | Yes | The data type (e.g., String, Number, Array, Object). |
Optional | No | Marks the field as not required to be present in the output. |
Default Value | No | A fallback value to use if the connected input is empty. |
Step 2: Select an Output Format
This setting controls the structure and level of detail in the final JSON object.
Full (Default): Returns a detailed object including component metadata like names and descriptions for each field.
Ideal for: Debugging and getting a comprehensive view of the output structure.
Step 3: Handle the Final Output
The component produces a single, consolidated JSON object based on your defined inputs and selected format.
Output | Description | Data Structure |
---|---|---|
Output | The final, structured JSON object representing the workflow's result. | A valid JSON object. The exact structure depends on the Output Format . |
Example (Minimal Format):
If you have two inputs, status
(value: "ok") and user_id
(value: 123), the output would be:
{
"status": "ok",
"user_id": 123
}
Best Practices
- End Skills with API Output: Always use
API Output
as the final step for any Agent Skill that has "Advanced Request Parts" enabled. This creates a formal, reliable contract for your skill's response. - Standardize Your Responses: Adopt a consistent response structure across all your skills (e.g.,
{ "success": true, "data": {...} }
or{ "success": false, "error": {...} }
). This makes your agent more robust and easier to integrate with. - Use Minimal for Production: The
Minimal
format is almost always the right choice for live skills, as it provides a clean and predictable output without unnecessary metadata. - Connect All Inputs: Ensure every input field in the
API Output
component is connected to the data it's supposed to represent from earlier in your workflow.
Troubleshooting Tips
What to Try Next
- Make this the final component in an Agent Skill to define its return value.
- Call a skill that uses
API Output
from an external application to see how it receives the clean, structured JSON response.