fix(API): Allow extendsCredential in workflow create/update (#39243)

Co-authored-by: Uddish Verma <uddish.verma@n8n.io>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Sam Wooler 2026-09-28 12:35:46 +00:00 committed by GitHub
parent 9bda02122d
commit 9e7bc6691c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 1 deletions

View File

@ -73,6 +73,18 @@ describe('CreateWorkflowPublicDto', () => {
expect(result.success).toBe(true);
});
test('accepts node.extendsCredential but ignores it', () => {
const result = CreateWorkflowPublicDto.safeParse({
...validPayload,
nodes: [{ ...validPayload.nodes[0], extendsCredential: 'datadogApi' }],
});
expect(result.success).toBe(true);
if (result.success) {
expect(result.data.nodes[0]).not.toHaveProperty('extendsCredential');
}
});
test.each([
['accepts', 155, true],
['rejects', 156, false],

View File

@ -51,10 +51,13 @@ const workflowNodeWritePublicSchema = z
.object({ tag: z.array(customTelemetryTagPublicSchema).optional() })
.strict()
.optional(),
// Accepted but ignored, this is an internal editor-produced marker for credential-only HTTP Request nodes
extendsCredential: z.string().optional(),
createdAt: readOnlyPublicSchema(readOnlyTimestampOpenApi),
updatedAt: readOnlyPublicSchema(readOnlyTimestampOpenApi),
})
.strict();
.strict()
.transform(({ extendsCredential: _extendsCredential, ...node }) => node);
const workflowNodeGroupWritePublicSchema = z
.object({

View File

@ -124,6 +124,8 @@ requestBody:
- value
additionalProperties: false
additionalProperties: false
extendsCredential:
type: string
createdAt:
type: string
format: date-time

View File

@ -141,6 +141,8 @@ requestBody:
- value
additionalProperties: false
additionalProperties: false
extendsCredential:
type: string
createdAt:
type: string
format: date-time