Commit Graph

139 Commits

Author SHA1 Message Date
Robin Braumann
dcf535a1c6
feat(core): Handle a busy agent session on each surface (no-changelog)
Each starter now reacts to a busy session in its own way:

- An integration message gets a busy notice. The bridge deletes its
  stored attachments and does not run the message.
- An integration button resume waits for the session for 5 seconds.
  Then it posts "This action has already been handled". A Preview
  resume waits the same time and then gets `turn_already_running`.
- A workflow-tool resume tries again with a backoff from 1 s to 30 s.
  It stops when the run is no longer suspended.
- A background wake skips without a failure count. The turn that holds
  the session requests a new wake when it settles.
- A busy sub-agent resume is retryable, so the parent stays suspended.

The session lease replaces the in-process HITL guard and the running
check of the wake, so this removes both and `existsRunningByThread`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 12:26:12 +02:00
Robin Braumann
b6f2869f06
feat(core): Take the session lease when an agent turn starts (no-changelog)
Take the session lease in the transaction that records the running
execution. All four start paths use this point: chat turns, failed starts,
foreground sub-agents, and workflow agents. A turn on a busy session gets
AgentTurnAlreadyRunningError and nothing is recorded.

The execution heartbeat renews the lease. Finalization releases it. When
a start takes over an expired lease, it marks the previous execution as
interrupted. The lease signal is combined with the abort signal of the
turn, so a lost lease stops the run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 11:56:42 +02:00
Robin Braumann
06ceed90e4
feat(core): Add agent session lease service (no-changelog)
Add the repository and service that take, renew, and release the lease
of an agent session. The lease uses the database clock. A lease that is
not renewed can be taken over by another main after two minutes.

The service keeps a registry of the leases that this main holds. It
aborts the local turn after two failed renewals, and it refuses a session
while an older local turn on that session is still settling.

Move AgentTurnAlreadyRunningError to its own file, so the lease can
throw it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 11:56:34 +02:00
Robin Braumann
cd1cacbe54
refactor(core): Share agent service helpers (no-changelog) 2026-09-22 21:24:53 +02:00
Robin Braumann
b048286161
Merge remote-tracking branch 'origin/master' into reattach-chat-owner-on-reload
# Conflicts:
#	packages/cli/src/modules/agents/agent-execution-orchestrator.service.ts
#	packages/frontend/editor-ui/src/features/agents/composables/useAgentChatStream.ts
2026-09-22 19:42:11 +02:00
ocdejong
5131af5ab7
feat(core): Report crashed executions to OTel through an execution-crashed event (#38853)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 15:36:32 +00:00
Robin Braumann
5ed678ae54
fix(core): Make agent session admission atomic (no-changelog) (#39307) 2026-09-22 15:22:16 +00:00
Robin Braumann
1707fcd465
fix: recover running preview chat after reload 2026-09-22 16:21:39 +02:00
Robin Braumann
dda9a56cb7
fix(core): Resume only private sessions in Preview (#39151) 2026-09-22 11:46:51 +00:00
Robin Braumann
5ba266db25
feat(core): Scope agent preview sessions to their owner (#39100) 2026-09-22 09:22:44 +00:00
Robin Braumann
6a678f02a0
fix(core): Remove checkpoints when deleting agent sessions (#39175) 2026-09-22 07:47:55 +00:00
Andreas Fitzek
32aa4629de
refactor: Add DB error predicates and drop TypeORM imports from execution and credential services (#38940) 2026-09-22 05:30:05 +00:00
Matsu
872b145ea8
refactor(core): Internalize cipher primitives (no-changelog) (#39148) 2026-09-22 08:08:02 +03:00
Guillaume Jacquart
b35d946929
feat(core): Add the credentialSave policy enforcement point (no-changelog) (#39099)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 19:44:58 +00:00
Robin Braumann
82b40c3218
refactor(core): Centralize agent conversation state checks (no-changelog) (#39038) 2026-09-21 10:55:17 +00:00
Robin Braumann
09cf3eb81d
refactor(core): Require agent execution recording (no-changelog) (#39075) 2026-09-21 08:31:57 +00:00
Andreas Fitzek
b3b5939ef9
perf(core): Stop loading project members when listing credentials (#39068) 2026-09-18 12:30:06 +00:00
Roman Makowiak
fe1012d75f
feat(core): Add the foundations for assistant-written preferences (no-changelog) (#38829)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 11:53:09 +00:00
Charlie Kolb
d3c8eee07e
fix(core): Include sub-workflow tool calls in the workflow dependency index (#38062)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-16 07:34:49 +00:00
Anne Aguirre
48445f5b9e
fix(core): Sweep parents parked on a finished sub-execution (#37553)
Co-authored-by: Emilia <100027345+sovietspaceship@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 12:17:14 +00:00
Eugene
7efefc7347
feat(editor): Show background tasks in the agent preview (#38360) 2026-09-15 07:35:56 +00:00
Andreas Fitzek
840aef623e
fix(core): Redact execution data on partial private-credential runs (#38364) 2026-09-11 11:24:54 +00:00
Robin Braumann
5de6a4071a
feat(core): Add agent-directed episodic memory capture (#38134)
Co-authored-by: Michael Drury <michael.drury@n8n.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-11 05:03:28 +00:00
Svetoslav Dekov
1cfd0959e3
feat(core): Add the shared AI preference repository and resolver service (no-changelog) (#38174)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Roman Makowiak <roman.makowiak@n8n.io>
2026-09-10 09:59:30 +00:00
Eugene
99e9730a01
feat(core): Notify parent agents when background jobs settle (#37617)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 14:15:38 +00:00
Eugene
588543cba8
feat(core): Store parent identity on background jobs (#37752)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-08 12:47:30 +00:00
Emilia
3521e54b81
fix(core): Count executions that crash recovery marks as crashed (#37733)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 11:29:15 +00:00
Eugene
9418c23b81
feat(core): Declare agents as a scheduled job owner (no-changelog) (#37848)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Emilia <100027345+sovietspaceship@users.noreply.github.com>
2026-09-07 15:28:55 +00:00
Emilia
afc4a54798
fix(core): Wait for detached sub-workflows before the worker stops its task runner (#37737)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 15:41:31 +00:00
Arvin A
47c9644392
feat(core): Let Instance AI read node-type usage from the dependency index (#37539) 2026-09-03 11:23:21 +00:00
Lorent Lempereur
7675c614bf
refactor(core): Own scheduled jobs by owner data rather than by workflow node (no-changelog) (#37134) 2026-09-02 20:10:43 +00:00
mfsiega
cae0c8be00
fix(core): Stop webhook routing locally before best-effort external teardown (#37241)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 11:55:28 +00:00
Danny Martini
946fb02849
feat(core): Give poll triggers an engine-derived time budget (no-changelog) (#37119)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 13:30:58 +00:00
Nour Alhadi Mahmoud
98e51043a8
perf(core): Chunk package ID lookups (#36923)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 10:29:30 +00:00
Benjamin Schroth
6b0de0d60f
fix(core): Report and reconcile agent channel startup failures (#36578)
Co-authored-by: Danny Martini <danny@n8n.io>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 14:35:15 +00:00
Danny Martini
be014224d3
perf(core): Read the poller state row once per durable poll tick (#36973)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 09:09:17 +00:00
Emilia
df8bfd9e56
feat(core): Back off a failing poll trigger instead of re-polling every tick (no-changelog) (#35707)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Lorent Lempereur <lorent.lempereur@n8n.io>
2026-08-21 23:17:17 +00:00
Robin Braumann
ead8ae16c4
feat(core): Add filters to agent sessions (#36493)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 13:58:12 +00:00
Kai
ec4ad66ed6
feat(editor): Show review status as a badge on the workflows list (#36476) 2026-08-18 16:26:52 +00:00
Robin Braumann
d551999c6c
fix(core): Surface failures in agent sessions (#36492)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 13:07:10 +00:00
Anne Aguirre
87e8b9c58f
fix(ai-builder): Fix for autosave and publish events issues (#36241)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 09:17:27 +00:00
Ali Elkhateeb
7060434f1f
refactor(API): Route public API credentials through the shared credentials service (#36048) 2026-08-17 13:14:21 +00:00
Danny Martini
b6b010e0d3
test(core): Cover deleteWorkflowCursors in the poller-state repository suite (no-changelog) (#36438)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 13:03:28 +00:00
Benjamin Schroth
79c1393cfb
fix(core): Make published agent channel add, replace, and remove failure-safe (#36100) 2026-08-14 13:09:15 +00:00
Mike Repeć
1a12af601b
fix(core): Report the real activation mode for triggers activated via the publication outbox (#36123)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 13:17:53 +00:00
Emilia
a9787fcd6f
feat(core): Commit a poll trigger's cursor and its execution in one transaction (no-changelog) (#35295)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Lorent Lempereur <lorent.lempereur@n8n.io>
2026-08-11 17:59:29 +00:00
Emilia
93ff542e92
feat(core): Add poller_state table for durable poll trigger cursors (no-changelog) (#35128)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Lorent Lempereur <lorent.lempereur@n8n.io>
2026-08-11 16:31:00 +00:00
Iván Ovejero
4afbd16dc7
ci: Run DB tests against the full supported Postgres range (#35960) 2026-08-11 09:49:07 +00:00
Kai
a044c0d1d8
feat(core): Auto-close workflow review requests when a workflow is archived or moved (#35772) 2026-08-07 12:53:25 +00:00
Danny Martini
1801f65d85
feat(core): Converge leader takeover through the reconciliation loop (#35454)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 06:24:49 +00:00