fix(core): Add optional context parameter to track creation source for workflows, credentials, and projects (#18736)

Co-authored-by: r00gm <raul00gm@gmail.com>
This commit is contained in:
Csaba Tuncsik
2025-08-27 10:50:53 +02:00
committed by GitHub
parent e665cbf278
commit 98bde4f478
20 changed files with 173 additions and 22 deletions

View File

@@ -145,6 +145,38 @@ describe('POST /workflows', () => {
);
});
test('should create workflow with uiContext parameter', async () => {
const payload = {
name: 'testing with context',
nodes: [
{
id: 'uuid-1234',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
typeVersion: 1,
position: [240, 300],
},
],
connections: {},
staticData: null,
settings: {},
active: false,
uiContext: 'workflow_list',
};
const response = await authMemberAgent.post('/workflows').send(payload);
expect(response.statusCode).toBe(200);
const {
data: { id, name },
} = response.body;
expect(id).toBeDefined();
expect(name).toBe('testing with context');
});
test('should create workflow history version when licensed', async () => {
license.enable('feat:workflowHistory');
const payload = {