Skip to content

Monitoring Background Jobs

Many operations in StrawBlond are processed asynchronously using background jobs to ensure fast response times and better user experience. This includes tasks like importing bank transactions, processing expenses, generating reports, and sending notifications.

Background job batches

When you trigger an operation that requires multiple background jobs (like importing a bank statement with many transactions), StrawBlond creates a batch to group these jobs together. This allows you to monitor the overall progress of the entire operation.

Monitoring batch progress

get
/batch/{batchId}

Use this endpoint to check the status of any background job batch using the batch ID returned from operations that create batches.

Example response

json
// HTTP 200 OK
{
    "id": "9c3b5e4d-8f2a-4b6c-9d1e-2f3a4b5c6d7e",
    "name": "bank_statement.xml",
    "totalJobs": 25,
    "pendingJobs": 5,
    "processedJobs": 18,
    "failedJobs": 2,
    "progress": 72,
    "finished": false,
    "cancelled": false
}

Batch status fields

FieldTypeDescription
idStringUnique batch identifier (UUID)
nameString?Human-readable name for the batch (often the original filename)
totalJobsIntegerTotal number of jobs assigned to the batch
pendingJobsIntegerNumber of jobs that have not been processed by the queue
processedJobsIntegerNumber of jobs that have been processed thus far
failedJobsIntegerNumber of jobs that have failed
progressIntegerProgress percentage of the batch (0-100)
finishedBooleanWhether the batch has finished executing
cancelledBooleanWhether the batch has been cancelled