mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2026-03-28 09:58:43 +07:00
38 lines
727 B
Markdown
38 lines
727 B
Markdown
# Custom variables
|
|
|
|
--8<-- "_snippets/code-examples/variables-list.md"
|
|
|
|
## Examples
|
|
|
|
### $executionId
|
|
|
|
Contains the unique ID of the current workflow execution.
|
|
|
|
```typescript
|
|
const executionId = $executionId;
|
|
|
|
return [{json:{executionId}}];
|
|
```
|
|
|
|
### $runIndex
|
|
|
|
Contains the index of the current run of the node.
|
|
|
|
```typescript
|
|
// 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.
|
|
|
|
```js
|
|
// Boolean. Whether the workflow is active (true) or not (false)
|
|
$workflow.active
|
|
// Number. The workflow ID.
|
|
$workflow.id
|
|
// String. The workflow name.
|
|
$workflow.name
|
|
```
|