WorkersInput output
Api
📸 Screenshots
Here are visual examples of this section:
Api - Worker Configuration Interface
1. Overview and Purpose
The API worker enables you to make HTTP requests to external services and APIs. It supports various HTTP methods, authentication types, custom headers, and parameters. This worker is essential for integrating external data sources and services into your Signpost AI workflows.
2. Configuration Parameters
endpoint: Fallback URL endpoint to call when no runtime endpoint is providedmethod: HTTP method to use (GET, POST, PUT, DELETE, etc.). Defaults to GETparams: JSON string containing URL query parameters to append to the requestheaders: JSON string containing custom HTTP headers to include in the requesttimeout: Request timeout in milliseconds. Defaults to 10000 (10 seconds)authType: Authentication method - 'none', 'basic', or 'bearer'username: Username for basic authentication (required when using basic auth)selectedKeyName: Name of the stored API key to use for authentication
3. Input/Output Handles
body: Input handle - accepts request body data for POST/PUT requestsendpointUrlInput: Input handle - accepts runtime endpoint URL (overrides parameter endpoint)response: Output handle - returns successful API response dataerror: Output handle - returns error messages when requests fail
4. Usage Examples with Code
// Example API call configuration
{
endpoint: "https://api.example.com/users",
method: "POST",
headers: '{"Content-Type": "application/json"}',
params: '{"limit": 10}',
authType: "bearer",
selectedKeyName: "my_api_key"
}5. Integration Examples
Use this worker to fetch data from external APIs, send notifications to webhooks, or integrate with third-party services. It can be chained with other workers to process API responses or use dynamic endpoints from previous workflow steps.
6. Best Practices
- Always set appropriate timeout values to prevent hanging requests
- Use the runtime endpoint input for dynamic URLs determined during workflow execution
- Store sensitive API keys in environment variables rather than hardcoding them
- Include proper error handling by connecting the error output to conditional logic
7. Troubleshooting Tips
- Check that the endpoint URL is valid and accessible from your environment
- Verify authentication credentials are correctly configured in your stored keys
- Ensure JSON formatting is valid in params and headers fields
- Monitor timeout settings for slow external APIs that may need longer response times
