When Jobs Are Used
For operations that process many items, ScriptBase uses async jobs:- Batch transcripts for >50 videos
- Batch video metadata for >50 videos
- Website crawling
Job Lifecycle
- Queued: Job is created and waiting to process
- Processing: Job is actively running
- Completed: Job finished successfully
- Failed: Job encountered an error
Creating a Job
Example: Batch transcript requestPolling Job Status
Use the job ID to check progress:While Processing
When Complete
Polling Pattern
Best Practices
Don't poll too frequently
Don't poll too frequently
Poll every 2-5 seconds. Polling every second wastes rate limit quota.
Implement timeout
Implement timeout
Set a maximum wait time (e.g., 10 minutes) to avoid infinite loops.
Handle failures gracefully
Handle failures gracefully
Check for
failed status and handle errors appropriately.Use webhooks (coming soon)
Use webhooks (coming soon)
Instead of polling, receive a webhook when the job completes.