Skip to main content

Overview

A job run represents a single execution instance of a job. When you create a job run, Anon executes all workflows defined in the job’s workflowExecutionOrder, creating individual workflow runs for each workflow and executing them sequentially. Job runs are the primary mechanism for initiating data operations. They orchestrate the complete workflow execution process, maintain execution state, track overall progress, and provide access to debugging tools.

Key Concepts

Job Run Lifecycle

Each job run progresses through states as it executes workflows:
  • PENDING: Job run created but execution hasn’t started
  • IN_PROGRESS: One or more workflows are currently executing
  • COMPLETED: All workflows completed successfully
  • FAILED: One or more workflows failed, halting execution
The job run status reflects the overall state of all workflow executions. Check individual workflow runs for detailed status of each step.

Configuration Snapshot

When a job run is created, it captures a snapshot of the job’s configuration in jobConfigJsonSnapshot. This ensures:
  • The job run executes with the configuration that existed at creation time
  • Changes to the job definition don’t affect running job runs
  • Historical job runs maintain accurate execution records
Example:
{
  "jobConfigJsonSnapshot": {
    "workflowExecutionOrder": [
      "login-workflow-id",
      "extraction-workflow-id"
    ]
  }
}

API Operations

List Job Runs

List Job Runs

Retrieve job runs for your organization with execution history and status

Get a Job Run

Get Job Run

Retrieve detailed information about a specific job run

Relationship with Other Resources

  • Jobs: The template defining what to execute
  • Workflow Runs: Individual executions of each workflow in the job
  • Workflows: The workflow definitions being executed
  • Artifacts: Generated by workflow runs during the job run

Monitoring Job Runs

Status Polling

Monitor job run progress by polling the API:
async function monitorJobRun(jobRunId) {
  let status = 'PENDING';
  
  while (!['COMPLETED', 'FAILED'].includes(status)) {
    const response = await fetch(`/job-runs/${jobRunId}`);
    const jobRun = await response.json();
    
    status = jobRun.status;
    console.log(`Job run status: ${status}`);
    
    // Check individual workflow runs for detailed progress
    const workflowRuns = await fetch(`/workflow-runs?jobRunId=${jobRunId}`);
    const { workflowRuns: runs } = await workflowRuns.json();
    
    runs.forEach(run => {
      console.log(`  Workflow ${run.workflowId}: ${run.status}`);
    });
    
    if (!['COMPLETED', 'FAILED'].includes(status)) {
      await sleep(10000); // Poll every 10 seconds
    }
  }
  
  return status;
}

Webhook Notifications

For event-driven monitoring, configure webhooks to receive notifications on job run state changes. See the Webhooks documentation for details.

Schema Reference

See the API Reference for complete schema definitions and field descriptions for the Job Run resource.