Temporal
Maybern uses Temporal for managing cron jobs and one-off scheduled tasks. Temporal provides durable execution guarantees and a UI for monitoring workflows.What is Temporal?
Temporal is a workflow orchestration platform that:- Runs scheduled/cron tasks reliably
- Provides visibility into running workflows
- Handles retries and failures gracefully
- Maintains execution history
Accessing Temporal
- Production
- Local Development
Access Temporal Cloud at cloud.temporal.ioLogin via SSO with your Maybern email.
Running Workers
Local Development
Start the Temporal worker:Running Workflows
Workflows are submitted to theshared-task-queue:
Example: Running a Backfill
To run a dry run of a backfill workflow:| Field | Value |
|---|---|
| Workflow ID | Random UUID |
| Task Queue | shared-task-queue |
| Workflow Type | RunManagementCommandWorkflow |
Viewing Logs
Workflow logs are available in Datadog:<env> is one of:
devcorpprod
Common Workflows
| Workflow | Description |
|---|---|
RunManagementCommandWorkflow | Runs Django management commands |
| Backfill workflows | Data migration and correction |
| Scheduled reports | Periodic report generation |
Best Practices
Use for Long-Running Tasks
Use for Long-Running Tasks
Temporal is ideal for:
- Multi-step workflows
- Tasks that need to survive restarts
- Operations requiring audit trails
Celery vs Temporal
Celery vs Temporal
Use Celery for:
- Real-time computation
- User-triggered async tasks
- High-throughput processing
- Scheduled/cron jobs
- Backfills and migrations
- Workflows needing durability guarantees
Always Use Dry-Run First
Always Use Dry-Run First
For backfills and data modifications, always run with Review the output before running without the flag.
--dry-run first: