Basic Workflow Example
This example demonstrates a simple webhook trigger that receives data, processes it, and sends a response. This is the foundational pattern for most n8n workflows.Workflow Overview
The workflow consists of:- Webhook Trigger - Receives incoming HTTP requests
- HTTP Request Node - Fetches additional data from an API
- Set Node - Transforms and structures the data
- Respond to Webhook - Returns the processed result
Use Cases
- API endpoint creation
- Data transformation pipelines
- Simple automation triggers
- Testing and development workflows
Complete Workflow JSON
Step-by-Step Breakdown
Webhook Trigger Setup
The webhook node listens for POST requests on the
/process-data path. It expects JSON data with owner and repo fields.Key Parameters:httpMethod: POST (accepts data in request body)path: Custom endpoint pathresponseMode: lastNode (returns data from final node)
Fetch Repository Data
The HTTP Request node uses the incoming data to fetch repository information from GitHub’s API.Key Features:
- Uses n8n expressions:
{{$json.owner}}and{{$json.repo}} - No authentication required for public repos
- 10-second timeout for reliability
Transform Response
The Set node extracts specific fields and formats the response data.Transformations:
- Extracts repository name, stars, description, and URL
- Uses type conversion (string, number)
- Creates clean, predictable output structure
Expected Response
Best Practice: Always validate your workflow with
validate_workflow() before deployment to catch configuration errors early.Common Modifications
Add Authentication
Update the HTTP Request node to include authentication:Add Error Handling
SetcontinueOnFail: true on the HTTP Request node to prevent workflow failures.
Rate Limiting
Add a Wait node between requests to respect API rate limits.Next Steps
- Learn about Webhook Integration patterns
- Explore Error Handling strategies
- Build Multi-Node Workflows with branching logic