Skip to main content

Quickstart: Workflow

This quickstart showcases how to write applications containing stateful, long-running, reliable workflows using the Workflow API. Start by developing locally with Dapr and the Diagrid Dashboard, then optionally onboard to Catalyst Online for managed workflow execution.


Part 1: Develop Locally with Dapr

Develop and test your workflows locally using Dapr and the Diagrid Dashboard for workflow visualization and debugging.

1

Prerequisites

Before you proceed, ensure you have the following prerequisites installed:

2

Install Diagrid CLI

Download and install the Diagrid CLI:

curl -o- https://downloads.diagrid.io/cli/install.sh | bash

Move the diagrid binary into your path:

sudo mv ./diagrid /usr/local/bin

Verify the installation:

diagrid version
3

Set Up Diagrid Dashboard

Run the dashboard:

docker run \
-p 8080:8080 \
ghcr.io/diagridio/diagrid-dashboard:0.0.1

Access the dashboard at http://localhost:8080.

4

Clone Quickstart Code

Clone the quickstart code from the Diagrid Labs GitHub repository:

diagrid dev quickstart --type workflow --language python

Navigate to the quickstart directory:

cd workflow-quickstart-<language>
5

Install Dependencies

Install .NET dependencies:

dotnet restore
6

Run Locally with Dapr

Run your application with Dapr locally. Make sure your state component is in the components directory.

dapr run --app-id order-workflow --app-port 5001 --dapr-http-port 3500 -- python main.py

Your application is now running locally with Dapr. You can view workflow executions in the Diagrid Dashboard.

6

Interact with Workflow API

With the quickstart running locally, test the Workflow API using curl or the REST Client extension with the test.rest file.

Start workflow

Open a new terminal and start a workflow instance:

curl -i -X POST http://localhost:5001/workflow/start -H "Content-Type: application/json" -d '{"name":"Car", "quantity":2}'

This returns the workflow instance ID. Save it as an environment variable for future API calls:

export INSTANCE_ID=<YOUR_WORKFLOW_INSTANCE_ID>

Get Workflow Status

Get the current workflow status:

curl -i -X GET http://localhost:5001/workflow/status/$WORKFLOW_ID

View in Dashboard

Navigate to http://localhost:8080 to see your workflow executions in the Diagrid Dashboard. You can:

  • List all workflow executions for the order-workflow app
  • Filter and page through executions
  • Drill into a single execution to see its status, metadata, and lifecycle

View the Diagrid Dashboard


Part 2: Onboard to Catalyst Online

Once you've developed and tested your workflows locally, onboard to Catalyst Online for managed workflow execution and additional features.

1

Log in to Catalyst Online

Authenticate to Diagrid Catalyst Online:

diagrid login

Confirm your organization and user details are correct:

diagrid whoami
2

Onboard to Catalyst Online

The diagrid dev run creates your Catalyst Online project (if needed), provisions resources (App IDs, Components, managed Pub/Sub and KV Store services), configures environment variables, and sets up the connection between your local environment and Catalyst Online.

diagrid dev run -f dev-python-workflow.yaml --project dev-python-workflow
3

Interact with Workflow API (Catalyst Online)

Test the Workflow API as before. Workflows are now executed by Catalyst Online:

curl -i -X POST http://localhost:5001/workflow/start -H "Content-Type: application/json" -d '{"name":"Car", "quantity":2}'

Save the workflow instance ID:

export WORKFLOW_ID=<YOUR_WORKFLOW_INSTANCE_ID>

Get workflow status:

curl -i -X GET http://localhost:5001/workflow/status/$WORKFLOW_ID

View detailed workflow logs using the Diagrid CLI:

diagrid workflow get $WORKFLOW_ID --app-id order-workflow

Use the Workflow viewer in the Catalyst Online web console to see detailed execution information:

workflow output


Clean Up

1

Clean Up Local ResourcesOptional

Stop the Diagrid Dashboard:

docker stop $(docker ps -q --filter ancestor=diagrid-dashboard:latest)

Remove the quickstart directory if desired:

cd ..
rm -rf workflow-quickstart-<language>
2

Offload from Catalyst OnlineOptional

To disconnect from Catalyst Online and remove the provisioned resources:

diagrid dev stop --project dev-python-workflow

This command will remove the connection between your local environment and Catalyst Online.

note

The diagrid dev stop command does not delete the Catalyst Online project and contained resources. To delete the entire project, use diagrid project delete <project-name>.