Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

limits updated (#1366)

Anshul sharma8fe41343d2f1
diff --git a/.claude/rules/workflow-matcher.md b/.claude/rules/workflow-matcher.md
index d25533add4..44ca33f91a 100644
--- a/.claude/rules/workflow-matcher.md
+++ b/.claude/rules/workflow-matcher.md
@@ -111,7 +111,7 @@ replay can never double-fire:
sends nothing.
- The Inngest event id is `` `${workflowId}:${workflowVersionId}:${sourceEventId}` ``.
- Both entry points also set Inngest `idempotency` (`event.data.msgId` /
- `event.data.momentId`) and a `limit: 10` per-`companyId` concurrency key.
+ `event.data.momentId`) and a `limit: 5` per-`companyId` concurrency key.
## Subscriptions are derived, never hand-managed
@@ -159,7 +159,7 @@ Kysely bypasses RLS. **The caller authorizes first** — phase 7's activation ro
- `events/workflow.ts` returns early on `TRUNCATE`; `record` is `new ?? old`, and
`before`/`after` are populated only for UPDATE.
- `workflows/run.ts` hands the payload to `src/workflows/engine/` and declares
- `idempotency: "event.data.runId"` plus per-`companyId` (10) and per-`workflowId` (5)
+ `idempotency: "event.data.runId"` plus per-`companyId` (5) and per-`workflowId` (5)
concurrency keys. See `workflow-engine.md`.
- Deploy-time drift checks live with `packages/checks`: the `workflow-trigger-event-drift`
SQL invariant and `pnpm --filter @carbon/checks workflow-events`.
diff --git a/packages/jobs/src/inngest/functions/events/workflow.ts b/packages/jobs/src/inngest/functions/events/workflow.ts
index ab6db395c1..c4874860ab 100644
--- a/packages/jobs/src/inngest/functions/events/workflow.ts
+++ b/packages/jobs/src/inngest/functions/events/workflow.ts
@@ -25,7 +25,7 @@ export const workflowFunction = inngest.createFunction(
retries: 3,
idempotency: "event.data.msgId",
concurrency: {
- limit: 10,
+ limit: 5,
key: "event.data.companyId"
}
},
diff --git a/packages/jobs/src/inngest/functions/workflows/moment.ts b/packages/jobs/src/inngest/functions/workflows/moment.ts
index 8d86ea436d..fd3a3c6355 100644
--- a/packages/jobs/src/inngest/functions/workflows/moment.ts
+++ b/packages/jobs/src/inngest/functions/workflows/moment.ts
@@ -20,7 +20,7 @@ export const workflowMomentFunction = inngest.createFunction(
retries: 3,
idempotency: "event.data.momentId",
concurrency: {
- limit: 10,
+ limit: 5,
key: "event.data.companyId"
}
},
diff --git a/packages/jobs/src/inngest/functions/workflows/run.ts b/packages/jobs/src/inngest/functions/workflows/run.ts
index 312229af85..8a9cb2dbe2 100644
--- a/packages/jobs/src/inngest/functions/workflows/run.ts
+++ b/packages/jobs/src/inngest/functions/workflows/run.ts
@@ -27,7 +27,7 @@ export const workflowRunFunction = inngest.createFunction(
retries: 3,
idempotency: "event.data.runId",
concurrency: [
- { limit: 10, key: "event.data.companyId" },
+ { limit: 5, key: "event.data.companyId" },
{ limit: 5, key: "event.data.workflowId" }
],
onFailure: async ({ event, logger }) => {