{"record":{"id":"c01ed181c5137206","repo":"n8n-io/n8n","slug":"agent-run-was-aborted","errorCode":null,"errorMessage":"Agent run was aborted","messagePattern":"Agent run was aborted","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/agents/src/runtime/loop/agent-runtime.ts","lineNumber":686,"sourceCode":"\t\t\t\t? { onStepEnd: options.onStepEnd ?? options.onStepFinish }\n\t\t\t\t: {}),\n\t\t\trepairToolCall: async (options) => {\n\t\t\t\treturn await fixToolCall(\n\t\t\t\t\t{\n\t\t\t\t\t\ttoolCall: options.toolCall,\n\t\t\t\t\t\terror: options.error,\n\t\t\t\t\t},\n\t\t\t\t\ttoolMap,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n\n\t/** Throw (and mark the run cancelled) if the abort scope has fired. */\n\tprivate assertNotAborted(abortScope: AgentAbortScope): void {\n\t\tif (abortScope.isAborted) {\n\t\t\tthis.updateState({ status: 'cancelled' });\n\t\t\tthrow new Error('Agent run was aborted');\n\t\t}\n\t}\n\n\t/** Build the shared services the output sinks call into for terminal concerns. */\n\tprivate createRunServices(): RunServices {\n\t\treturn {\n\t\t\trunId: this.runId,\n\t\t\tmodelId: this.modelIdString,\n\t\t\tapplyCost: (usage) => this.applyCost(usage),\n\t\t\tsaveToMemory: async (list, options) => await this.memory.saveToMemory(list, options),\n\t\t\tmaybeGenerateTitle: async (list, options) => await this.maybeGenerateTitle(list, options),\n\t\t\tflushTelemetry: async (options) => await this.telemetry.flush(options),\n\t\t\tcleanupRun: async () => await this.cleanupRun(),\n\t\t\tupdateState: (patch) => this.updateState(patch),\n\t\t\temitAgentEnd: (messages) => this.eventBus.emit({ type: AgentEvent.AgentEnd, messages }),\n\t\t\tgetState: () => this.getState(),\n\t\t};\n\t}","sourceCodeStart":668,"sourceCodeEnd":704,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/agents/src/runtime/loop/agent-runtime.ts#L668-L704","documentation":"Thrown by the Set node validator (v3.3+) when parameters.assignments is present but is not an object/record. The correct shape is an object containing an assignments array: { assignments: [...] }. A bare array, string, or number here is a structural mistake.","triggerScenarios":"nodeVersion >= 3.3 AND params.assignments !== undefined AND isRecord(assignments) is false (it is null, an array, or a primitive).","commonSituations":"An AI builder writes assignments: [{...}] (an array) instead of assignments: { assignments: [{...}] }; mis-reading the v3.3 schema; flattening the structure during a refactor.","solutions":["Wrap the array: set parameters.assignments to { assignments: [ ...your assignment objects ] }.","If you did not intend to set assignments, remove the key entirely (undefined is allowed and skips validation).","Re-check the v3.3 assignment schema: each entry needs id, name, value, type."],"exampleFix":"// before\nset({\n  name: 'Set X',\n  assignments: [{ id: '1', name: 'x', value: 1, type: 'number' }],\n});\n\n// after\nset({\n  name: 'Set X',\n  assignments: {\n    assignments: [{ id: '1', name: 'x', value: 1, type: 'number' }],\n  },\n});","handlingStrategy":"type-guard","validationCode":"function isRecord(v: unknown): v is Record<string, unknown> {\n  return typeof v === 'object' && v !== null && !Array.isArray(v);\n}\n\n// before building:\nif (params.assignments !== undefined && !isRecord(params.assignments)) {\n  throw new Error('parameters.assignments must be an object { assignments: [...] }');\n}","typeGuard":"function isRecord(v: unknown): v is Record<string, unknown> {\n  return typeof v === 'object' && v !== null && !Array.isArray(v);\n}","tryCatchPattern":null,"preventionTips":["Remember the v3.3 shape is { assignments: [...] }, not a bare array.","Generate assignments from a typed factory that always wraps the array.","Validate the outer shape before adding entries."],"tags":["set-node","assignments","parameters","node-version"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}