mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2026-03-28 01:48:44 +07:00
727 B
727 B
Custom variables
--8<-- "_snippets/code-examples/variables-list.md"
Examples
$executionId
Contains the unique ID of the current workflow execution.
const executionId = $executionId;
return [{json:{executionId}}];
$runIndex
Contains the index of the current run of the node.
// Returns all items the node "IF" outputs (index: 0 which is Output "true" of the same run as current node)
const allItems = $items("IF", 0, $runIndex);
$workflow
Gives information about the current workflow.
// Boolean. Whether the workflow is active (true) or not (false)
$workflow.active
// Number. The workflow ID.
$workflow.id
// String. The workflow name.
$workflow.name