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:

  1. Receives webhook requests
  2. Fetches product data from an external API
  3. Validates the response
  4. Transforms valid products
  5. Logs invalid items
  6. 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

  1. Open your project in the Console
  2. Click Workflows in the left sidebar
  3. Click + Create Workflow
  4. Fill in the details:
    • Name: Product Sync
    • Key: product-sync
    • Description: Fetches and processes product data
  5. Click Create

The workflow editor opens with an empty canvas.

Step 2: Add a Webhook Trigger

  1. From the Triggers section in the node palette, drag a Request Trigger onto the canvas
  2. Click the trigger node to open its configuration panel
  3. Configure the webhook:
    • Path: /products/sync
    • Methods: Select POST
  4. Click Save

This creates an endpoint that will trigger your workflow when it receives HTTP requests.

Step 3: Add an HTTP Request Node

  1. From the Actions section, drag a Request node onto the canvas
  2. Connect the trigger's output port to the request node's input port
  3. Configure the request:
    • URL: https://api.example.com/products
    • Method: POST
    • Headers: Add Authorization with value Bearer {{variables.apiToken}}
  4. Click Save

:::alert{type="info"} The {{variables.apiToken}} syntax references a workflow variable. We'll set this up later. :::

Step 4: Add Validation Logic

  1. Drag a Script node onto the canvas
  2. Connect the request node's main output to the script node
  3. Name it "Validate Products"
  4. 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

  1. Drag another Script node for transformation
  2. Connect from the validation node
  3. Click on the edge (connection line) to configure it
  4. Add a condition to only pass valid items
  5. Name this node "Transform Products"
  6. Write transformation logic to format the data

Route Invalid Products

  1. Drag a Script node for error logging
  2. Connect from the validation node with a separate edge
  3. Configure the edge condition to pass invalid items
  4. Name this node "Log Errors"
  5. Write logging logic

Your workflow now has two parallel paths from the validation node.

Step 6: Configure the Response

  1. Click on the workflow's Response configuration
  2. Select response type:
    • Status: Returns execution status only
    • Script: Custom response with your data
    • Debug: Full execution details (for development)
  3. For this workflow, use Script to return the transformed products

Step 7: Add Variables

Store sensitive configuration values securely.

  1. Click Settings in the workflow toolbar
  2. Navigate to the Variables tab
  3. Click Add Variable
  4. Configure the API token:
    • Key: apiToken
    • Value: Your API token
    • Secret: Toggle ON
  5. Click Save

Variables marked as secret are encrypted and never exposed in logs.

Step 8: Save and Deploy

Save Your Workflow

  1. Click Save in the toolbar
  2. Review the workflow summary
  3. Confirm the save

Deploy to Runner

  1. Click Deploy
  2. Select your target runner instance from the dropdown
  3. Click Deploy
  4. Wait for the status to change to Ready

Step 9: Test Your Workflow

From the Console

  1. Click Run in the toolbar
  2. Enter test input data (product IDs to fetch)
  3. Click Execute
  4. View the execution results in the output panel
  5. 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?