Skip to main content
Test locally first. The workflow playground lets you validate logic without running the full API stack.

Local Testing Setup

Use pre-defined test events in requests/events and the playground script at playground/workflow_playground.py to execute workflows directly.

Running a Test

To test your workflow locally, use the following simple pattern:
event = EventFactory.create_event(event_key="product")
workflow = CustomerCareWorkflow()
result = workflow.run(event)
The event_key parameter corresponds to a JSON file name in the requests/events directory. For example, event_key="product" loads requests/events/product.json.

Benefits of Local Testing

Immediate Feedback

You see results instantly without waiting for async processing or checking databases.

Easy Debugging

Add breakpoints and step through your workflow logic in your IDE.

No Dependencies

You can test without running Docker containers, Celery workers, or databases.

Rapid Iteration

Modify and test workflow logic quickly without restarting services.

Creating Custom Test Events

To add your own test events:
1

Create JSON file

Add a new JSON file to requests/events/ with your test data
2

Match schema

Ensure the JSON structure matches your event schema exactly
3

Reference by name

Use the filename (without .json) as the event_key in EventFactory
I