Commit Graph

1598 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
6fa50f6495
fix(core): Keep agent chat session pointer across restarts (no-changelog)
Store the active session of an integration conversation in the database
instead of the cache. The default cache is in memory. A restart sent each
conversation that used /new or an idle timeout back to its first session.

The pointer is a key in the metadata of the agents_resources row for the
base thread ID. Session deletion does not remove that row.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 10:57:00 +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
Kai
8012f017bc
feat(API): Create projects with source IDs and package metadata (#39218) 2026-09-22 16:41:52 +00: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
Uddish Verma
86a8ffe96a
refactor(API): Migrate GET and POST /workflows/{workflowId}/test-runs to the decorator pattern (no-changelog) (#39163)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 15:14:03 +00:00
Sam Wooler
428bab3201
feat(API): Migrate users write endpoints to the decorator pattern (#39120)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 14:38:03 +00:00
Robin Braumann
1707fcd465
fix: recover running preview chat after reload 2026-09-22 16:21:39 +02:00
n8n-cat-bot[bot]
f86d227dc5
chore: Migrate DELETE /api/v1/projects/:projectId/folders/:folderId to @PublicApiController + Zod (#38617)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Ali Elkhateeb <ali.elkhateeb@n8n.io>
2026-09-22 14:07:41 +00:00
Rúben Castro
fb0c332006
fix(core): Summarize saved credential type policies against known credential types (no-changelog) (#39191)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 13:58:58 +00:00
n8n-cat-bot[bot]
cae5062e3a
refactor(API): Migrate GET /discover to the decorator pattern (no-changelog) (#39162)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Uddish Verma <uddish.verma@n8n.io>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 13:23:51 +00:00
Veljko Terzic
4d8c29adbe
feat(core): Run the agent checkpoint pruning as a durable system task (no-changelog) (#39269) 2026-09-22 13:10:30 +00:00
Sam Wooler
6433934db7
feat(API): Migrate GET /users endpoints to the decorator pattern (#38599)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 12:49:05 +00:00
Robin Braumann
dda9a56cb7
fix(core): Resume only private sessions in Preview (#39151) 2026-09-22 11:46:51 +00:00
Matsu
196ed7f450
refactor(core): Enforce persistence boundaries in code (no-changelog) (#39170) 2026-09-22 13:14:00 +03:00
Rúben Castro
cff3a1c9db
feat(core): Add credential type policy instance and project endpoints (no-changelog) (#39111)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 09:33:06 +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
n8n-cat-bot[bot]
f840c58934
chore: Migrate PATCH /api/v1/projects/:projectId/folders/:folderId to @PublicApiController + Zod (#38618)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Ali Elkhateeb <ali.elkhateeb@n8n.io>
2026-09-22 07:45:49 +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
Ricardo Espinoza
4e3a7720cf
feat(core): Let MCP discover and install verified community nodes (no-changelog) (#37374)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-21 21:44:05 +00: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
Konstantin Tieber
4faeb001ba
feat(core): Support disabling certain permission scopes in personal space for canvas only (no-changelog) (#38858)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 16:07:42 +00:00
Arvin A
4198ba9915
feat(core): Gate the activity record on a rollout flag (no-changelog) (#38822) 2026-09-21 14:15:43 +00:00
Arvin A
bd454d403d
fix(core): Correct the instance-context read surface (no-changelog) (#38815) 2026-09-21 14:15:43 +00:00
Savelii
f0325776c1
feat(core): Add view and delete permissions for executions to project roles (#38698)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 13:21:59 +00:00
Rúben Castro
e76cf87d44
feat(core): Add the credential-types policy kind and fix package rule matching (no-changelog) (#38854)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 11:57:02 +00:00
Robin Braumann
82b40c3218
refactor(core): Centralize agent conversation state checks (no-changelog) (#39038) 2026-09-21 10:55:17 +00:00
Guillaume Jacquart
fc0c3ca23a
perf(core): Coalesce policy scope reads and demote the cache TTL (no-changelog) (#39085) 2026-09-21 08:38:29 +00:00
Robin Braumann
09cf3eb81d
refactor(core): Require agent execution recording (no-changelog) (#39075) 2026-09-21 08:31:57 +00:00
n8n-cat-bot[bot]
7c6425e74e
refactor(API): Migrate GET /insights/summary to @PublicApiController (#38600)
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Uddish Verma <uddish.verma@n8n.io>
2026-09-18 15:05:54 +00:00
Nour Alhadi Mahmoud
f3c5a5751e
fix(core): Keep workflow version ids out of the package content file and the promotion diff (#39091)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-09-18 14:49:17 +00:00
Andreas Fitzek
b3b5939ef9
perf(core): Stop loading project members when listing credentials (#39068) 2026-09-18 12:30:06 +00:00
Sam Wooler
a2ab0d5f60
refactor(API): Migrate POST /credentials/{credentialId}/test and GET /credentials/schema/{credentialTypeName} to the decorator pattern (no-changelog) (#38638)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-18 11:27:11 +00:00
Nour Alhadi Mahmoud
c87a6e5219
feat(API): Let promotion Apply pin the reviewed commit (no-changelog) (#39052)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 11:13:30 +00:00
Kai
85b3be3526
feat(API): Allow credential creation with source IDs (#38791) 2026-09-18 11:08:47 +00:00
James Martin
ec54145304
fix(core): Apply the same mandatory roles when creating role from API and frontend (#38860)
Co-authored-by: Savelii <savelii.sychov@n8n.io>
2026-09-18 09:10:55 +00:00
James Martin
7b059d64f1
fix(editor): Split global variable scopes to be added to custom roles separately (#38724) 2026-09-18 08:50:32 +00:00
Guillaume Jacquart
e530b79b5a
feat(core): Lock credential decryption to available node types (no-changelog) (#38988)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 07:42:00 +00:00
Guillaume Jacquart
4dfec51b8b
test(core): Cover policy fan-out atomicity and cross-main reads (no-changelog) (#38950)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 19:27:42 +00:00
Nour Alhadi Mahmoud
0ee4d1f812
feat(core): Preview promotion changes in both directions and on the public API (no-changelog) (#38847)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 15:43:36 +00:00
Arvin A
33def0e800
feat(core): Add a description field to credentials (no-changelog) (#38839) 2026-09-17 13:16:34 +00:00
Arvin A
ba16e4f08d
feat(core): Give MCP clients the opening instance context (no-changelog) (#38292) 2026-09-17 13:16:10 +00:00
Veljko Terzic
9059a89078
feat(core): Run the JTI cleanup as a durable system task (no-changelog) (#38596) 2026-09-17 12:55:14 +00:00
Kai
74334d2d85
feat(API): Pause promotion Apply until bindings are resolved (#38741) 2026-09-17 11:56:35 +00:00