HTTP Request
The HTTP Request step allows you to make HTTP requests to any API endpoint. This enables integration with external services, webhooks, and custom APIs.Overview
HTTP Request steps are powerful for:- Integrating with third-party APIs
- Calling webhooks
- Fetching data from external services
- Triggering actions in other systems
- Building custom integrations
Configuration
When you add an HTTP Request step, you’ll configure:HTTP Method
Select the HTTP method for your request:- GET: Retrieve data from an endpoint
- POST: Create new resources or send data
- PUT: Update or replace resources
- PATCH: Partially update resources
- DELETE: Remove resources
- HEAD: Retrieve headers without body
- OPTIONS: Get allowed methods for an endpoint
URL
Enter the full URL of the API endpoint:URLs can include workflow variables. Use
{{variable.name}} syntax to insert dynamic values into the URL.Headers
Add custom HTTP headers for your request:- Authorization: API keys, Bearer tokens, etc.
- Content-Type: Specify the request body format
- Custom headers: Any additional headers required by the API
Request Body
Configure the request body based on the body type:Body Type
Choose the format for your request body:- JSON: Send JSON data (most common for REST APIs)
- Form Data: Send form-encoded data
- Raw Text: Send plain text
- XML: Send XML data
Body Content
Enter the body content. You can use workflow variables to insert dynamic values:Response Handling
HTTP Request steps return response data that can be used in subsequent steps:- Response Body: The response content (JSON, text, etc.)
- Status Code: HTTP status code (200, 404, 500, etc.)
- Headers: Response headers from the API
Response data is automatically parsed and available as workflow variables in subsequent steps. JSON responses are parsed into accessible variables.
Example Use Cases
User Creation API
Create a user in an external system:Webhook Notification
Send a webhook notification:Data Fetching
Fetch data from an external API:Error Handling
HTTP Request steps can fail for various reasons:- Network errors: Connection timeouts, DNS failures
- HTTP errors: 4xx (client errors) or 5xx (server errors)
- Invalid responses: Malformed JSON or unexpected formats
Best Practices
Use Secure Headers
Use Secure Headers
Store sensitive data like API keys in workflow variables rather than hardcoding them. This keeps credentials secure and makes them reusable.
Validate Responses
Validate Responses
Use flow control steps to check response status codes and handle different outcomes appropriately.
Handle Timeouts
Handle Timeouts
Be aware that HTTP requests have timeout limits. For long-running operations, consider using webhooks or polling instead.
Test API Endpoints
Test API Endpoints
Test your HTTP requests with sample data before deploying workflows to ensure endpoints are accessible and responses are as expected.
Use Appropriate Methods
Use Appropriate Methods
Use GET for retrieving data, POST for creating resources, PUT/PATCH for updates, and DELETE for removals. This follows REST API conventions.