Motivation
When a job exhausts its retries and lands in Failed, the only recovery today is
to re-run the originating code by hand. An operational requeue would let a
dev or admin re-enqueue a failed job straight from its AsyncResult__c record,
which matters most after a transient outage leaves a batch of jobs failed.
This is distinct from retry(): retry() is automatic, runs inside the failure
path, and is bounded by maxRetries and backoff. Requeue is manual and runs
after a job is already in terminal Failed, with a fresh attempt counter.
Proposal
- An entry point to re-enqueue a failed job by
AsyncResult__c id (or custom job
id): reconstruct / clone the job and push it back through the normal enqueue
path with a fresh attempt counter.
- Optional bulk requeue for a set of failed results.
- If the monitoring console ships, expose this as a row action / button there.
Notes
- Requires the job payload to be reconstructable. Document the constraint: either
the job state is serialized on failure, or requeue is limited to jobs that
carry their own inputs.
- Guard with a custom permission so not every user can requeue.
Acceptance criteria
- Requeue path plus permission gate.
- Apex tests: single + bulk requeue, non-failed result rejected, missing payload
handled cleanly.
- Docs.
Motivation
When a job exhausts its retries and lands in
Failed, the only recovery today isto re-run the originating code by hand. An operational requeue would let a
dev or admin re-enqueue a failed job straight from its
AsyncResult__crecord,which matters most after a transient outage leaves a batch of jobs failed.
This is distinct from
retry():retry()is automatic, runs inside the failurepath, and is bounded by
maxRetriesand backoff. Requeue is manual and runsafter a job is already in terminal
Failed, with a fresh attempt counter.Proposal
AsyncResult__cid (or custom jobid): reconstruct / clone the job and push it back through the normal enqueue
path with a fresh attempt counter.
Notes
the job state is serialized on failure, or requeue is limited to jobs that
carry their own inputs.
Acceptance criteria
handled cleanly.