$workflow.executionId [GOT CREATED]

In the execution of a workflow, we have access to the $workflow data: isActive, workflowId, workflowName.

I think that now you know the final id of the execution when it starts. Assuming that, it would be nice if we could have access to the execution id also. It could be something like $workflow.executionId. Other data that now is available could also be added.

I saw in the packages/workflow/src/WorkflowDataProxy.ts that it gets the data from the object of the type Workflow (packages/workflow/src/Workflow.ts). So the execution Id isn’t in this class, so instead of putting it in the $workflow, it would make more sense to create an $execution variable.

Anyway, I would love to have the execution id in the workflow, so then I have to debug something outside, I could just look up the id returned in some webhook and easily find the execution I should look, instead of looking through dozens of executions and maybe dealing with cases that the executions weren’t saved (by wrong settings or bugs).

Oh, I ran into this too. I generate a unique code in the process and I need to compare the returned code with a specific launch. Then I can save information which code was generated at which start. Is there a solution for this?

Topical is a good idea. Only the error trigger currently gets this data: https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/nodes/ErrorTrigger.node.ts

I am also looking for this. It will help us better in troubleshooting and developing the better workflows.

2 Likes

I am sure you have all found it by now but we do have {{ $execution.id }} available which will return the execution id of the running workflow.

1 Like