Background Jobs
Cron jobs trigger API routes to process queued operations and scheduled tasks.Terra has two types of background processing:
- Queue Processor — Processes async operations (webhooks, emails, Airtable syncs)
- Lifecycle Worker — Handles scheduled form lifecycle events (auto-publish, auto-close)
Queue Processor
The queue processor handles async operations that were enqueued during form submission.Operation Types
Lifecycle Worker
The lifecycle worker handles scheduled form events and cleanup tasks.Task Breakdown
Scheduled Publishing
Forms can be scheduled to publish automatically:Form Auto-Freezing
Forms are automatically frozen after receiving their first submission:Cron Configuration
Both workers are triggered via Vercel Cron Jobs:API Endpoints
Monitoring
Queue Health
Worker Health
The worker returns detailed results:Error Handling
Both workers handle errors gracefully:- Per-item isolation: One failed operation doesn’t block others
- Logging: All errors are logged with context
- Retry logic: Queue operations retry with exponential backoff
- Dead letter: Persistently failing operations are marked as failed
Local Development
For local testing, you can trigger workers manually:Queue Architecture
How the async queue works
Webhooks
Webhook delivery system