Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Order Processing Workflow

Developer demo showing how to build a production-ready e-commerce workflow in Orkes Conductor.
The workflow automates order creation, payment processing, inventory updates, and fulfillment confirmation.


Prerequisites

  • Google account or email to sign into Orkes Playground (free)
  • Basic understanding of REST APIs
  • Familiarity with JSON (helpful but not required)

The Problem We're Solving

When a customer places an order on an e-commerce site, multiple things need to happen:

  1. Process their payment
  2. Check if the payment succeeded
  3. If yes: reserve inventory, send confirmation email, notify warehouse
  4. If no: send failure notification

Coordinating all these steps across different services is complex. Conductor makes it simple.


Step 1: Access Orkes Playground

Go to Orkes Playground.

You'll see the Launch Pad with two options: browse pre-built workflow templates or start from scratch.

Orkes Launch Pad

The Orkes Conductor Launch Pad — click "Start from Scratch" to begin.

For this tutorial, click "Start from Scratch" so you can learn how to build a workflow from the ground up.

You'll be prompted to log in.

Login Prompt

Login screen — sign in with Google or email to access the platform.

Sign in with your Google account or email. Once logged in, you'll be taken to the main Conductor interface.


Step 2: Navigate to Workflow Definitions

New Workflow Canvas

The workflow creation interface after clicking "Start from Scratch" — shows an empty canvas ready to build.

From the main interface, navigate to Definitions → Workflow in the left sidebar.
Click the "Create Workflow" button in the top right.


Step 3: Set Up Workflow Details

You'll see the workflow configuration form. Fill it out:

Name: E-Commerce Order Processing

Description:
When a customer places an order, this workflow handles everything: payment processing, inventory checks, email confirmations, and shipping coordination.
Shows how to build resilient, production-ready automation for e-commerce systems.

Leave the other settings at their defaults for now.

Workflow Details Filled

Workflow Details form filled with name and description.


Step 4: Define Input Parameters

Scroll down to Input and Output Parameters.
Click "Add parameter" five times and add these keys:

  1. orderId
  2. customerId
  3. customerEmail
  4. totalAmount
  5. items
Input and Output Parameters

All input parameters (orderId, customerId, customerEmail, totalAmount, items) and output parameter (trackingNumber) configured.


Step 5: Add an Output Parameter

Still in the parameters section, scroll to Output parameters and add:
Parameter: trackingNumber

Leave the Value field blank — it will be filled during execution.


Step 6: Build the Payment Processing Task

Click the "Task" tab at the top.

Task Tab Empty Canvas

The Task tab shows a visual canvas with Start and End nodes.

Click the + button below Start.

Task Picker Menu

The task picker menu — select HTTP Task.

Select "HTTP Task" from Quick Add.


Step 7: Configure the Payment Task

Click on the HTTP task to configure it.

Reference name: process_payment
Method: POST
URL: https://httpbin.org/post

Scroll to the Body section and replace {} with:

{
  "orderId": "${workflow.input.orderId}",
  "customerId": "${workflow.input.customerId}",
  "totalAmount": "${workflow.input.totalAmount}",
  "paymentMethod": "credit_card"
}
HTTP Task Configuration

HTTP task configured with POST method and order details.


Step 8: Add Conditional Logic

Click the + button below process_payment.

Add Switch Task

Add a Switch task for conditional routing.

Select "Switch" task.

Switch Task Added

The Switch task appears on the canvas as a diamond shape for branching.


Step 9: Configure the Payment Check

Click on the Switch task.

Reference name: check_payment_status
Key: paidValue: success
Evaluate: ECMASCRIPT
Code:

$.paid

Switch case key: success

Switch Task Configuration

Switch task configured with ECMASCRIPT evaluation.


Step 10: Save and Test Your Workflow

Click "Save".

Save Workflow

Click Save to validate and store your workflow configuration.

Run your workflow to test. You'll see tasks executing in real-time.

Workflow Execution

Completed workflow execution showing payment processing and confirmation.


Step 11: Add Email Confirmation Task

On the success branch, click the + icon and add another HTTP Task.

Reference name: send_confirmation_email
Method: POST
URL: https://httpbin.org/post

Body:

{
  "to": "${workflow.input.customerEmail}",
  "subject": "Order Confirmation",
  "orderId": "${workflow.input.orderId}",
  "message": "Your order has been confirmed!"
}
Email Task Configuration

Email confirmation task sends notification when payment succeeds.

Save your workflow — it should look like this:

Complete Workflow Structure

Complete workflow showing all tasks connected: payment → switch → email.


Workflow Summary

Start
  ↓
Process Payment (HTTP POST)
  ↓
Check Payment Status (SWITCH)
  ↓ (success)
Send Confirmation Email (HTTP POST)
  ↓
End

Next Steps

  • Add FORK Tasks to run inventory updates and notifications in parallel.
  • Add error handling for payment failures.
  • Connect to real APIs (Stripe, PayPal, SendGrid).
  • Configure retry logic and timeouts for resilience.

Resources


Questions or suggestions?
Open an issue or reach out!

About

Orkes Conductor demo: build a payment-to-fulfillment e-commerce workflow with HTTP and Switch tasks in 20 minutes. Workflow includes payment processing, email confirmations, and coordinated order fulfillment for an automated pipeline using the Orkes Playground.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors