Getting Started

Build your first integration in less than 15 minutes

Let's build a simple order fulfillment integration. When a new order is placed, it gets automatically sent to a fulfilment centre for processing, and then the order status is updated.

Create a New Workflow

  1. Click "New Workflow"

  2. Name it "Order Fulfillment"

The workflow will receive as input order data in the following format (Click to expand)
{
  "id": 1,
  "orderNumber": "ORD-1751999768784",
  "customerName": "Sarah Johnson",
  "customerEmail": "[email protected]",
  "status": "pending",
  "total": "234.50",
  "shippingAddressLine1": "123 Main Street",
  "shippingAddressLine2": "Apt 4B",
  "shippingCity": "New York",
  "shippingState": "NY",
  "shippingZipCode": "10001",
  "shippingCountry": "US",
  "createdAt": "2025-01-08T18:36:08.000Z",
  "updatedAt": "2025-01-08T18:36:08.000Z",
  "items": [
    {
      "id": 1,
      "orderId": 1,
      "productId": 1,
      "quantity": 2,
      "price": "129.99",
      "product": {
        "id": 1,
        "name": "Wireless Earbuds Pro",
        "sku": "WEP-001",
        "category": "Electronics",
        "price": "129.99",
        "stock": 25,
        "status": "active",
        "description": "High-quality wireless earbuds",
        "imageUrl": "https://images.unsplash.com/photo-1572569511254-d8f925fe2cbb"
      }
    }
  ]
}

Adding Steps to Workflow

1

Transforming incoming order data

First up, we'll need to create a new step to convert incoming order schema to fulfillment centre format.

{
  "id": 5,
  "orderNumber": "ORD-1752204924208",
  "customerName": "Lisa Chen",
  "customerEmail": "[email protected]",
  "status": "pending",
  "total": "299.99",
  "shippingAddressLine1": "789 Oak Drive",
  "shippingAddressLine2": "Unit 5",
  "shippingCity": "Seattle",
  "shippingState": "WA",
  "shippingZipCode": "98101",
  "shippingCountry": "US",
  "trackingUrl": null,
  "shipmentReferenceId": null,
  "createdAt": "2025-07-11T03:35:24.196Z",
  "updatedAt": "2025-07-11T03:35:24.208Z",
  "items": [
    {
      "id": 9,
      "orderId": 5,
      "productId": 2,
      "quantity": 1,
      "price": 299.99,
      "product": {
        "id": 2,
        "name": "Smart Watch Series X",
        "sku": "SWX-002",
        "category": "Electronics",
        "price": 299.99,
        "stock": 12,
        "status": "active",
        "description": "Advanced smartwatch with health monitoring",
        "imageUrl": "https://images.unsplash.com/photo-1523275335684-37898b6baf30?ixlib=rb-4.0.3&auto=format&fit=crop&w=96&h=96",
        "createdAt": "2025-07-08T18:36:08.439Z",
        "updatedAt": "2025-07-08T18:36:08.446Z"
      }
    }
  ]
}
  1. Click "Create New Step"

  2. Name it "Transform incoming order data"

  3. Select preferred language. For this tutorial, we will use Javascript

  4. Click on the icon to select the step type. For this step, we'll keep Data Transformation

Once the step is created, we can now start adding transformation logic to our step.

(data) => {
    const inputOrder = data.input;

    // Use Array.map to transform the items array
    const transformedItems = inputOrder.items.map(item => ({
        sku: item.product.sku,
        name: item.product.name,
        quantity: item.quantity,
        price: parseFloat(item.price) // Convert price from string to number
    }));

    // Construct the final output object
    const outputOrder = {
        customer_name: inputOrder.customerName,
        customer_email: inputOrder.customerEmail,
        customer_phone: "+1234567890", // Placeholder as source data is missing
        shipping_address: {
            street: `${inputOrder.shippingAddressLine1 || ''} ${inputOrder.shippingAddressLine2 || ''}`.trim(),
            city: inputOrder.shippingCity,
            state: inputOrder.shippingState,
            zip: inputOrder.shippingZipCode,
            country: inputOrder.shippingCountry
        },
        items: transformedItems,
        shipping_method: "standard" // Default value as source data is missing
    };

    return outputOrder;
}
2

Send Order to Fulfillment Centre

Next up, we'll create a new step to send the transformed order data to the fulfillment centre via API.

  1. Click "Create New Step"

  2. Name it "Send Order to Fulfillment Centre"

  3. Click on the icon to select the step type. For this step, we'll select HTTP Request

We will then write logic for sending order data to fulfillment centre via HTTP Request.

(data) => {
    // The body of the request is the output from the previous step (step_1)
    const requestBody = data.step_1.data;

    return {
        "lam.httpRequest": {
            "method": "POST",
            "url": "https://shipping-logistics-loic21.replit.app/api/orders",
            "headers": {
                "Content-Type": "application/json"
            },
            "body": requestBody
        }
    };
}
3

Update Order Status

Finally, we'll add a final step to update the order status.

  1. Click "Create New Step"

  2. Name it "Update order status"

  3. Click on the icon to select the step type. For this step, we'll select HTTP Request

We will add logic for updating order status via HTTP Request.

(data) => {
    // Get the order ID from the initial workflow input
    const orderId = data.input.id;
    
    // Get the tracking URL and number from the response of the previous step (step_2)
    const tracking_url = data.step_2.response.tracking_url
    const tracking_number = data.step_2.response.tracking_number

    return {
        "lam.httpRequest": {
            "method": "PUT",
            "url": `https://order-track-pro-loic21.replit.app/api/orders/${orderId}`,
            "headers": {
                "Content-Type": "application/json"
            },
            "body": {
                "status": "Processing",
                "tracking_url": tracking_url,
                "shipment_reference_id": tracking_number,
            }
        }
    };
}

Run your Workflow

We are now ready to test our workflow. We will be using the input below to run our workflow

  • Provide Test Input (Use test input below)

  • Click Run Workflow Button

Order Test Input (Click to expand)
{
  "id": 5,
  "orderNumber": "ORD-1752204924208",
  "customerName": "Lisa Chen",
  "customerEmail": "[email protected]",
  "status": "pending",
  "total": "299.99",
  "shippingAddressLine1": "789 Oak Drive",
  "shippingAddressLine2": "Unit 5",
  "shippingCity": "Seattle",
  "shippingState": "WA",
  "shippingZipCode": "98101",
  "shippingCountry": "US",
  "trackingUrl": null,
  "shipmentReferenceId": null,
  "createdAt": "2025-07-11T03:35:24.196Z",
  "updatedAt": "2025-07-11T03:35:24.208Z",
  "items": [
    {
      "id": 9,
      "orderId": 5,
      "productId": 2,
      "quantity": 1,
      "price": 299.99,
      "product": {
        "id": 2,
        "name": "Smart Watch Series X",
        "sku": "SWX-002",
        "category": "Electronics",
        "price": 299.99,
        "stock": 12,
        "status": "active",
        "description": "Advanced smartwatch with health monitoring",
        "imageUrl": "https://images.unsplash.com/photo-1523275335684-37898b6baf30?ixlib=rb-4.0.3&auto=format&fit=crop&w=96&h=96",
        "createdAt": "2025-07-08T18:36:08.439Z",
        "updatedAt": "2025-07-08T18:36:08.446Z"
      }
    }
  ]
}

After running your workflow, you'll see a new entry in the workflow executions section:

  • Overall Status: Success or failure indicator

  • Step Results: Individual step outputs and execution logs

  • Data Flow: How data moved between steps

  • Execution Time: Performance metrics for each step

Now that you've built your first workflow, let's dive deeper into creating more sophisticated integrations. Building effective workflows requires understanding how data flows between steps and mastering the different types of operations you can perform.

Last updated

Was this helpful?