Getting Started with Workflows
Create your first automated workflow in the dcupl Console. This tutorial walks you through building a data processing pipeline using the visual editor.
What You'll Build
flowchart LR
T[Webhook Trigger] --> F[Fetch Products]
F --> V{Validate}
V -->|Valid| Tr[Transform]
V -->|Invalid| L[Log Error]
Tr --> R[Return Response]
A workflow that:
- Receives webhook requests
- Fetches product data from an external API
- Validates the response
- Transforms valid products
- Logs invalid items
- Returns the processed data
Prerequisites
- A dcupl Console account at console.dcupl.com
- A project created in the Console
- A runner instance available for deployment
Step 1: Create a New Workflow
- Open your project in the Console
- Click Workflows in the left sidebar
- Click + Create Workflow
- Fill in the details:
- Name: Product Sync
- Key: product-sync
- Description: Fetches and processes product data
- Click Create
The workflow editor opens with an empty canvas.
Step 2: Add a Webhook Trigger
- From the Triggers section in the node palette, drag a Request Trigger onto the canvas
- Click the trigger node to open its configuration panel
- Configure the webhook:
- Path:
/products/sync - Methods: Select
POST
- Path:
- Click Save
This creates an endpoint that will trigger your workflow when it receives HTTP requests.
Step 3: Add an HTTP Request Node
- From the Actions section, drag a Request node onto the canvas
- Connect the trigger's output port to the request node's input port
- Configure the request:
- URL:
https://api.example.com/products - Method:
POST - Headers: Add
Authorizationwith valueBearer {{variables.apiToken}}
- URL:
- Click Save
:::alert{type="info"}
The {{variables.apiToken}} syntax references a workflow variable. We'll set this up later.
:::
Step 4: Add Validation Logic
- Drag a Script node onto the canvas
- Connect the request node's
mainoutput to the script node - Name it "Validate Products"
- In the script editor, write validation logic:
- Check each product has required fields (id, name, price)
- Separate valid and invalid items
- Return both sets for different processing paths
The script node has access to incoming items via $items() and can return transformed data.
Step 5: Add Conditional Routing
Route Valid Products
- Drag another Script node for transformation
- Connect from the validation node
- Click on the edge (connection line) to configure it
- Add a condition to only pass valid items
- Name this node "Transform Products"
- Write transformation logic to format the data
Route Invalid Products
- Drag a Script node for error logging
- Connect from the validation node with a separate edge
- Configure the edge condition to pass invalid items
- Name this node "Log Errors"
- Write logging logic
Your workflow now has two parallel paths from the validation node.
Step 6: Configure the Response
- Click on the workflow's Response configuration
- Select response type:
- Status: Returns execution status only
- Script: Custom response with your data
- Debug: Full execution details (for development)
- For this workflow, use Script to return the transformed products
Step 7: Add Variables
Store sensitive configuration values securely.
- Click Settings in the workflow toolbar
- Navigate to the Variables tab
- Click Add Variable
- Configure the API token:
- Key:
apiToken - Value: Your API token
- Secret: Toggle ON
- Key:
- Click Save
Variables marked as secret are encrypted and never exposed in logs.
Step 8: Save and Deploy
Save Your Workflow
- Click Save in the toolbar
- Review the workflow summary
- Confirm the save
Deploy to Runner
- Click Deploy
- Select your target runner instance from the dropdown
- Click Deploy
- Wait for the status to change to Ready
Step 9: Test Your Workflow
From the Console
- Click Run in the toolbar
- Enter test input data (product IDs to fetch)
- Click Execute
- View the execution results in the output panel
- Check the execution log for each node's input/output
Using cURL
curl -X POST \
'https://your-runner.dcupl.com/workflow/product-sync/trigger/request/products/sync' \
-H 'api-key: your-api-key' \
-H 'Content-Type: application/json' \
-d '{"productIds": ["prod-001", "prod-002"]}'Expected Result
The workflow returns transformed product data with:
- Formatted fields
- Processing timestamp
- Success status
Invalid products are logged separately and don't block the main flow.
Troubleshooting
Workflow Not Triggering
- Verify the endpoint URL is correct
- Check the API key is included in requests
- Ensure the runner status shows Ready
Script Errors
- Check the Console browser console for JavaScript errors
- Verify
$items()returns data - Use
console.log()in scripts for debugging
HTTP Request Failures
- Check the target URL is accessible
- Verify authentication headers are correct
- Review the error output port for details
Connection Issues
- Ensure all required input ports are connected
- Check that edge conditions aren't filtering all items
- Verify node configurations are saved
What's Next?
- Workflows Overview - Deep dive into nodes, edges, and merge strategies
- RAPI - Deploy workflows as REST APIs
- AI Features - Generate workflows with AI assistance