Deprecate enqueueJob in favor of enqueueJobs batch mutation (#24691)
## What
Deprecates `enqueueJob` and replaces it with `enqueueJobs`, which
enqueues one run per payload of a single logic function in a single
call.
## Changes
**twenty-server**
- New `enqueueJobs` mutation taking `EnqueueJobsInput {
logicFunctionUniversalIdentifier, payloads: [JSON!]!, retryLimit,
delayMs }` (1 to 200 payloads per batch, options apply to the whole
batch) and returning `EnqueueJobsResult { enqueued,
logicFunctionUniversalIdentifier, enqueuedJobsCount }`.
- The target function is resolved and validated before anything is
enqueued; the whole batch goes through a single
`messageQueueService.bulkAdd` call.
- `enqueueJob` is marked `@deprecated` in the schema and now delegates
to `enqueueJobs` internally with a one-element `payloads` list.
**twenty-sdk**
- New `enqueueJobs` helper exported from `twenty-sdk/logic-function`;
`enqueueJob` is marked `@deprecated`.
- Changelog entry under Unreleased.
**twenty-shared**
- New `EnqueueJobsInput` / `EnqueueJobsResult` types.
**Generated**
- `twenty-client-sdk` metadata client and `twenty-front`
generated-metadata types regenerated against a running server.
**Docs**
- `background-jobs.mdx` rewritten around `enqueueJobs`, with a note
pointing `enqueueJob` users at the replacement.
## Tests
- Unit specs for the new SDK helper (mutation shape, auth header,
GraphQL error surfacing).
- Integration specs: a batch of payloads runs through the worker,
unknown-function rejection, empty batch rejection.
## Notes
- Public apps (`last-contact`, `fireflies`) still call the deprecated
`enqueueJob`; migrating them to batched calls is left as a follow-up
since it touches app versioning/changelogs. Note their per-job `delayMs`
staggering maps to one `enqueueJobs` call per delay step under the
batch-level options.
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/24691?utm_source=github"
rel="nofollow noreferrer noopener" target="_blank">``<img alt="Review
in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg">``</a> M
martmull committed
981c90d7562b57155b4bfeebbe7d787526d808b2
Parent: f09c89a
Committed by GitHub <noreply@github.com>
on 8/24/2026, 2:55:26 PM