mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2026-03-27 09:28:43 +07:00
split out methods and vars
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
/code-examples/javascript-functions/console-log/ /code/cookbook/code-node/console-log/
|
||||
/code-examples/ai-code/ /code/ai-code/
|
||||
/code-examples/expressions/check-incoming-data/ /code/cookbook/expressions/check-incoming-data/
|
||||
/code-examples/expressions/ /code/understand-expressions/
|
||||
/code-examples/expressions/understand-expressions/ /code/understand-expressions/
|
||||
/code-examples/javascript-functions/ /code/code-node/
|
||||
/code-examples/javascript-functions/code-node/ /code/code-node/
|
||||
/code-examples/expressions/luxon/ /code/luxon/
|
||||
/code-examples/javascript-functions/luxon/ /code/luxon/
|
||||
@@ -18,6 +20,7 @@
|
||||
/code-examples/javascript-functions/jmespath/ /code/jmespath/
|
||||
/code-examples/methods-variables-examples/* /code/cookbook/builtin/:splat
|
||||
|
||||
|
||||
###
|
||||
|
||||
/hosting/authentication/user-management-self-hosted/ /hosting/user-management-self-hosted/
|
||||
|
||||
12
docs/code/builtin/advanced.md
Normal file
12
docs/code/builtin/advanced.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
description: Built-in methods for advances tasks.
|
||||
contentType: reference
|
||||
---
|
||||
|
||||
# Advanced
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :---------------------: |
|
||||
| `$evaluateExpression` | Evaluates a string as an expression | :white_check_mark: |
|
||||
| `$jmespath()` | Perform a search on a JSON object using JMESPath. | :white_check_mark: |
|
||||
| `$vars` | Contains the [Variables](/variables/) available in the active environment. | :white_check_mark: |
|
||||
14
docs/code/builtin/convenience.md
Normal file
14
docs/code/builtin/convenience.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description: n8n provides these methods to make it easier to perform common tasks in expressions.
|
||||
contentType: reference
|
||||
---
|
||||
|
||||
# Convenience methods
|
||||
|
||||
n8n provides these methods to make it easier to perform common tasks in expressions.
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :---------------------: |
|
||||
| `$if()` | The `$if()` function takes three parameters: a condition, the value to return if true, and the value to return if false. | :x: |
|
||||
| `$max()` | Returns the highest of the provided numbers. | :x: |
|
||||
| `$min()` | Returns the lowest of the provided numbers. | :x: |
|
||||
19
docs/code/builtin/current-node-input.md
Normal file
19
docs/code/builtin/current-node-input.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
description: Methods for working with the input of the current node.
|
||||
contentType: reference
|
||||
---
|
||||
|
||||
# Current node input
|
||||
|
||||
Methods for working with the input of the current node. Note that some methods and variables aren't available in the Code node.
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :-------------------------: |
|
||||
| `$binary` | Shorthand for `$input.item.binary`. Incoming binary data from a node | :x: |
|
||||
| `$input.item` | The input item of the current node that's being processed. Refer to [Item linking](/data/data-mapping/data-item-linking/) for more information on paired items and item linking. | :white_check_mark: |
|
||||
| `$input.all()` | All input items in current node. | :white_check_mark: |
|
||||
| `$input.first()` | First input item in current node. | :white_check_mark: |
|
||||
| `$input.last()` | Last input item in current node. | :white_check_mark: |
|
||||
| `$input.params` | Object containing the query settings of the previous node. This includes data such as the operation it ran, result limits, and so on. | :white_check_mark: |
|
||||
| `$json` | Shorthand for `$input.item.json`. Incoming JSON data from a node. Refer to [Data structure](/data/data-structure/) for information on item structure. | :x: |
|
||||
| `$input.context.noItemsLeft` | Boolean. Only available when working with the Split in Batches node. Provides information about what's happening in the node, allowing you to see if the node is still processing items. | :white_check_mark: |
|
||||
@@ -9,7 +9,7 @@ contentType: reference
|
||||
A reference document listing built-in convenience functions to support data transformation in expressions for arrays.
|
||||
|
||||
!!! note "JavaScript in expressions"
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code-examples/expressions/) for more information.
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code/understand-expressions/) for more information.
|
||||
|
||||
[[% import "_macros/data-functions.html" as dataFunctions %]]
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ contentType: reference
|
||||
A reference document listing built-in convenience functions to support data transformation in expressions for dates.
|
||||
|
||||
!!! note "JavaScript in expressions"
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code-examples/expressions/) for more information.
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code/understand-expressions/) for more information.
|
||||
|
||||
[[% import "_macros/data-functions.html" as dataFunctions %]]
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ contentType: overview
|
||||
Data transformation functions are helper functions to make data transformation easier in expressions.
|
||||
|
||||
!!! note "JavaScript in expressions"
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code-examples/expressions/) for more information.
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code/understand-expressions/) for more information.
|
||||
|
||||
For a list of available functions, refer to the page for your data type:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ contentType: reference
|
||||
A reference document listing built-in convenience functions to support data transformation in expressions for numbers.
|
||||
|
||||
!!! note "JavaScript in expressions"
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code-examples/expressions/) for more information.
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code/understand-expressions/) for more information.
|
||||
|
||||
[[% import "_macros/data-functions.html" as dataFunctions %]]
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ contentType: reference
|
||||
A reference document listing built-in convenience functions to support data transformation in expressions for objects.
|
||||
|
||||
!!! note "JavaScript in expressions"
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code-examples/expressions/) for more information.
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code/understand-expressions/) for more information.
|
||||
|
||||
[[% import "_macros/data-functions.html" as dataFunctions %]]
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ contentType: reference
|
||||
A reference document listing built-in convenience functions to support data transformation in expressions for strings.
|
||||
|
||||
!!! note "JavaScript in expressions"
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code-examples/expressions/) for more information.
|
||||
You can use any JavaScript in expressions. Refer to [Expressions](/code/understand-expressions/) for more information.
|
||||
|
||||
[[% import "_macros/data-functions.html" as dataFunctions %]]
|
||||
|
||||
|
||||
18
docs/code/builtin/date-time.md
Normal file
18
docs/code/builtin/date-time.md
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
description: Methods for working with date and time.
|
||||
contentType: reference
|
||||
---
|
||||
|
||||
# Built-in date and time methods
|
||||
|
||||
Methods for working with date and time. Note that some methods and variables aren't available in the Code node.
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :-------------------------: |
|
||||
| `$now` | A Luxon object containing the current timestamp. Equivalent to `DateTime.now()`. | :white_check_mark: |
|
||||
| `$today` | A Luxon object containing the current timestamp, rounded down to the day. Equivalent to `DateTime.now().set({ hour: 0, minute: 0, second: 0, millisecond: 0 })`. | :white_check_mark: |
|
||||
|
||||
|
||||
n8n passes dates between nodes as strings, so you need to parse them. Luxon helps you do this. Refer to [Date and time with Luxon](/code/luxon/) for more information.
|
||||
|
||||
n8n provides built-in convenience functions to support data transformation in expressions for dates. Refer to [Data transformation functions | Dates](/code/builtin/data-transformation-functions/dates/) for more information.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description:
|
||||
contentType: overview
|
||||
---
|
||||
|
||||
# Built-in methods and variables
|
||||
|
||||
n8n provides built-in methods and variables for working with data and accessing n8n data. This section provides a reference of available methods and variables, with a short description.
|
||||
|
||||
!!! "Availability in the expressions editor and the Code node"
|
||||
Some methods and variables aren't available in the Code node. These are noted in the documentation.
|
||||
|
||||
All data transformation functions are only available in the expressions editor.
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
---
|
||||
description: Built-in methods and variables you can use in expressions and code in n8n.
|
||||
contentType: reference
|
||||
---
|
||||
|
||||
# Built-in methods and variables
|
||||
|
||||
n8n provides built-in methods and variables for working with data and accessing n8n data. This document provides a reference list of available methods and variables, with a short description. Note that some methods and variables aren't available in the Code node.
|
||||
|
||||
|
||||
## Current node input
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :-------------------------: |
|
||||
| `$binary` | Shorthand for `$input.item.binary`. Incoming binary data from a node | :x: |
|
||||
| `$input.item` | The input item of the current node that's being processed. Refer to [Item linking](/data/data-mapping/data-item-linking/) for more information on paired items and item linking. | :white_check_mark: |
|
||||
| `$input.all()` | All input items in current node. | :white_check_mark: |
|
||||
| `$input.first()` | First input item in current node. | :white_check_mark: |
|
||||
| `$input.last()` | Last input item in current node. | :white_check_mark: |
|
||||
| `$input.params` | Object containing the query settings of the previous node. This includes data such as the operation it ran, result limits, and so on. | :white_check_mark: |
|
||||
| `$json` | Shorthand for `$input.item.json`. Incoming JSON data from a node. Refer to [Data structure](/data/data-structure/) for information on item structure. | :x: |
|
||||
| `$input.context.noItemsLeft` | Boolean. Only available when working with the Split in Batches node. Provides information about what's happening in the node, allowing you to see if the node is still processing items. | :white_check_mark: |
|
||||
|
||||
|
||||
## Output of other nodes
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :-------------------------: |
|
||||
| `$("<node-name>").all(branchIndex?, runIndex?)` | Returns all items from a given node. | :white_check_mark: |
|
||||
| `$("<node-name>").first(branchIndex?, runIndex?)` | The first item output by the given node | :white_check_mark: |
|
||||
| `$("<node-name>").last(branchIndex?, run Index?)` | The last item output by the given node. | :white_check_mark: |
|
||||
| `$("<node-name>").item` | The linked item. This is the item in the specified node used to produce the current item. Refer to [Item linking](/data/data-mapping/data-item-linking/) for more information on item linking. | :x: |
|
||||
| `$("<node-name>").params` | Object containing the query settings of the given node. This includes data such as the operation it ran, result limits, and so on. | :white_check_mark: |
|
||||
| `$("<node-name>").context` | Only available when working with the Split in Batches node. Provides information about what's happening in the node, allowing you to see if the node is still processing items. | :white_check_mark: |
|
||||
| `$("<node-name>").itemMatching(currentNodeinputIndex)` | Use instead of `$("<node-name>").item` in the Code node if you need to trace back from an input item. | :white_check_mark: |
|
||||
|
||||
|
||||
|
||||
<!-- possibly not live yet?
|
||||
|
||||
|
||||
| `$("<node-name>").itemAt(itemIndex, branchIndex?, runIndex?)` | [TODO: is this in? not working in expr] Returns an item at a given index. Replaces `$item()`. | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Date and time
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :-------------------------: |
|
||||
| `$now` | A Luxon object containing the current timestamp. Equivalent to `DateTime.now()`. | :white_check_mark: |
|
||||
| `$today` | A Luxon object containing the current timestamp, rounded down to the day. Equivalent to `DateTime.now().set({ hour: 0, minute: 0, second: 0, millisecond: 0 })`. | :white_check_mark: |
|
||||
|
||||
|
||||
## n8n metadata
|
||||
|
||||
This includes:
|
||||
|
||||
* Access to n8n environment variables for self-hosted n8n.
|
||||
* Metadata about workflows, executions, and nodes.
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :-------------------------: |
|
||||
| `$env` | Contains n8n instance configuration [environment variables](/hosting/environment-variables/environment-variables/). | :white_check_mark: |
|
||||
| `$execution.customData` | Set and get custom execution data. Refer to [Custom executions data](/workflows/executions/custom-executions-data/) for more information. | :white_check_mark: |
|
||||
| `$execution.id` | The unique ID of the current workflow execution. | :white_check_mark: |
|
||||
| `$execution.mode` | Whether the execution was triggered automatically, or by manually running the workflow. Possible values are `test` and `production`. | :white_check_mark: |
|
||||
| `$execution.resumeUrl` | The webhook URL to call to resume a workflow waiting at a [Wait node](/integrations/builtin/core-nodes/n8n-nodes-base.wait/). | :white_check_mark: |
|
||||
| `$getWorkflowStaticData(type)` | View an [example](/code/cookbook/builtin/get-workflow-static-data/). Static data doesn't persist when testing workflows. The workflow must be active and called by a trigger or webhook to save static data. This gives access to the static workflow data. | :white_check_mark: |
|
||||
| `$itemIndex` | The index of an item in a list of items. | :x: |
|
||||
| `$prevNode.name` | The name of the node that the current input came from. When using the Merge node, note that `$prevNode` always uses the first input connector. | :white_check_mark: |
|
||||
| `$prevNode.outputIndex` | The index of the output connector that the current input came from. Use this when the previous node had multiple outputs (such as an If or Switch node). When using the Merge node, note that `$prevNode` always uses the first input connector. | :white_check_mark: |
|
||||
| `$prevNode.runIndex` | The run of the previous node that generated the current input. When using the Merge node, note that `$prevNode` always uses the first input connector. | :white_check_mark: |
|
||||
| `$runIndex` | How many times n8n has executed the current node. Zero-based (the first run is 0, the second is 1, and so on). | :white_check_mark: |
|
||||
| `$workflow.active` | Whether the workflow is active (true) or not (false). | :white_check_mark: |
|
||||
| `$workflow.id` | The workflow ID. | :white_check_mark: |
|
||||
| `$workflow.name` | The workflow name. | :white_check_mark: |
|
||||
|
||||
## Convenience methods
|
||||
|
||||
n8n provides these methods to make it easier to perform common tasks in expressions.
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :---------------------: |
|
||||
| `$if()` | The `$if()` function takes three parameters: a condition, the value to return if true, and the value to return if false. | :x: |
|
||||
| `$max()` | Returns the highest of the provided numbers. | :x: |
|
||||
| `$min()` | Returns the lowest of the provided numbers. | :x: |
|
||||
|
||||
|
||||
## Advanced
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :---------------------: |
|
||||
| `$evaluateExpression` | Evaluates a string as an expression | :white_check_mark: |
|
||||
| `$jmespath()` | Perform a search on a JSON object using JMESPath. | :white_check_mark: |
|
||||
| `$vars` | Contains the [Variables](/variables/) available in the active environment. | :white_check_mark: |
|
||||
|
||||
32
docs/code/builtin/n8n-metadata.md
Normal file
32
docs/code/builtin/n8n-metadata.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
description: Methods for working with n8n metadata.
|
||||
contentType: reference
|
||||
---
|
||||
|
||||
# n8n metadata
|
||||
|
||||
Methods for working with n8n metadata.
|
||||
|
||||
This includes:
|
||||
|
||||
* Access to n8n environment variables for self-hosted n8n.
|
||||
* Metadata about workflows, executions, and nodes.
|
||||
|
||||
Note that some methods and variables aren't available in the Code node.
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :-------------------------: |
|
||||
| `$env` | Contains n8n instance configuration [environment variables](/hosting/environment-variables/environment-variables/). | :white_check_mark: |
|
||||
| `$execution.customData` | Set and get custom execution data. Refer to [Custom executions data](/workflows/executions/custom-executions-data/) for more information. | :white_check_mark: |
|
||||
| `$execution.id` | The unique ID of the current workflow execution. | :white_check_mark: |
|
||||
| `$execution.mode` | Whether the execution was triggered automatically, or by manually running the workflow. Possible values are `test` and `production`. | :white_check_mark: |
|
||||
| `$execution.resumeUrl` | The webhook URL to call to resume a workflow waiting at a [Wait node](/integrations/builtin/core-nodes/n8n-nodes-base.wait/). | :white_check_mark: |
|
||||
| `$getWorkflowStaticData(type)` | View an [example](/code/cookbook/builtin/get-workflow-static-data/). Static data doesn't persist when testing workflows. The workflow must be active and called by a trigger or webhook to save static data. This gives access to the static workflow data. | :white_check_mark: |
|
||||
| `$itemIndex` | The index of an item in a list of items. | :x: |
|
||||
| `$prevNode.name` | The name of the node that the current input came from. When using the Merge node, note that `$prevNode` always uses the first input connector. | :white_check_mark: |
|
||||
| `$prevNode.outputIndex` | The index of the output connector that the current input came from. Use this when the previous node had multiple outputs (such as an If or Switch node). When using the Merge node, note that `$prevNode` always uses the first input connector. | :white_check_mark: |
|
||||
| `$prevNode.runIndex` | The run of the previous node that generated the current input. When using the Merge node, note that `$prevNode` always uses the first input connector. | :white_check_mark: |
|
||||
| `$runIndex` | How many times n8n has executed the current node. Zero-based (the first run is 0, the second is 1, and so on). | :white_check_mark: |
|
||||
| `$workflow.active` | Whether the workflow is active (true) or not (false). | :white_check_mark: |
|
||||
| `$workflow.id` | The workflow ID. | :white_check_mark: |
|
||||
| `$workflow.name` | The workflow name. | :white_check_mark: |
|
||||
20
docs/code/builtin/output-other-nodes.md
Normal file
20
docs/code/builtin/output-other-nodes.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
description: Methods for working with the output of other nodes.
|
||||
contentType: reference
|
||||
---
|
||||
|
||||
# Output of other nodes
|
||||
|
||||
Methods for working with the output of other nodes. Note that some methods and variables aren't available in the Code node.
|
||||
|
||||
## Output of other nodes
|
||||
|
||||
| Method | Description | Available in Code node? |
|
||||
| ------ | ----------- | :-------------------------: |
|
||||
| `$("<node-name>").all(branchIndex?, runIndex?)` | Returns all items from a given node. | :white_check_mark: |
|
||||
| `$("<node-name>").first(branchIndex?, runIndex?)` | The first item output by the given node | :white_check_mark: |
|
||||
| `$("<node-name>").last(branchIndex?, run Index?)` | The last item output by the given node. | :white_check_mark: |
|
||||
| `$("<node-name>").item` | The linked item. This is the item in the specified node used to produce the current item. Refer to [Item linking](/data/data-mapping/data-item-linking/) for more information on item linking. | :x: |
|
||||
| `$("<node-name>").params` | Object containing the query settings of the given node. This includes data such as the operation it ran, result limits, and so on. | :white_check_mark: |
|
||||
| `$("<node-name>").context` | Only available when working with the Split in Batches node. Provides information about what's happening in the node, allowing you to see if the node is still processing items. | :white_check_mark: |
|
||||
| `$("<node-name>").itemMatching(currentNodeinputIndex)` | Use instead of `$("<node-name>").item` in the Code node if you need to trace back from an input item. | :white_check_mark: |
|
||||
@@ -2,6 +2,6 @@
|
||||
contentType: overview
|
||||
---
|
||||
|
||||
# Overview
|
||||
# Examples using n8n's built-in methods and variables
|
||||
|
||||
n8n provides built-in methods and variables for working with data and accessing n8n data. This section provides usage examples.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
description: Code examples you can use in the Code node.
|
||||
contentType: overview
|
||||
---
|
||||
|
||||
# Code node cookbook
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
description: Code examples you can use in expressions.
|
||||
contentType: overview
|
||||
---
|
||||
|
||||
# Expressions cookbook
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
description: A collection of code examples.
|
||||
contentType: overview
|
||||
---
|
||||
|
||||
# Cookbook
|
||||
|
||||
@@ -17,7 +17,7 @@ There are two places in your workflows where you can use code:
|
||||
|
||||
Use expressions to transform [data](/data/) in your nodes. You can use JavaScript in expressions, as well as n8n's [Built-in methods and variables](/code/builtin/) and [Data transformation functions](/code/builtin/data-transformation-functions/).
|
||||
|
||||
[:octicons-arrow-right-24: Expressions](/code-examples/expressions/)
|
||||
[:octicons-arrow-right-24: Expressions](/code/understand-expressions/)
|
||||
|
||||
- __Code node__
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ contentType: howto
|
||||
|
||||
# Date and time with Luxon
|
||||
|
||||
[Luxon](https://github.com/moment/luxon/) is a JavaScript library that makes it easier to work with date and time. For full details of how to use Luxon, refer to [Luxon's documentation](https://moment.github.io/luxon/#/?id=luxon).
|
||||
[Luxon](https://github.com/moment/luxon/){:target=_blank .external-link} is a JavaScript library that makes it easier to work with date and time. For full details of how to use Luxon, refer to [Luxon's documentation](https://moment.github.io/luxon/#/?id=luxon){:target=_blank .external-link}.
|
||||
|
||||
n8n passes dates between nodes as strings, so you need to parse them. Luxon makes this easier.
|
||||
|
||||
## Variables
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ In a Code node, create an array of objects named `myContacts` that contains the
|
||||
|
||||
## Referencing node data with the Code node
|
||||
|
||||
Just like you can use [expressions](/code-examples/expressions/) to reference data from other nodes, you can also use some [methods and variables](/code/builtin/) in the Code node.
|
||||
Just like you can use [expressions](/code/understand-expressions/) to reference data from other nodes, you can also use some [methods and variables](/code/builtin/) in the Code node.
|
||||
|
||||
### Exercise
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ n8n displays it in table form like this:
|
||||
|
||||
## Map data in the expressions editor
|
||||
|
||||
These examples show how to access linked items in the expressions editor. Refer to [expressions](/code-examples/expressions/) for more information on expressions, including built in variables and methods.
|
||||
These examples show how to access linked items in the expressions editor. Refer to [expressions](/code/understand-expressions/) for more information on expressions, including built in variables and methods.
|
||||
|
||||
### Access the linked item in a previous node's output
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ The details and scope of this workflow will vary greatly according to the indivi
|
||||
|
||||
* This workflow must be triggered by a [Webhook](/integrations/builtin/core-nodes/n8n-nodes-base.webhook/) node.
|
||||
* The incoming webhook call must contain the user’s credentials and any other workflow parameters required.
|
||||
* Each node where the user’s credentials are needed should use an [expression](/code-examples/expressions/) so that the node’s credential field reads the credential provided in the webhook call.
|
||||
* Each node where the user’s credentials are needed should use an [expression](/code/understand-expressions/) so that the node’s credential field reads the credential provided in the webhook call.
|
||||
* Save and activate the workflow, ensuring the production URL is selected for the Webhook node. Refer to [webhook node](/integrations/builtin/core-nodes/n8n-nodes-base.webhook/) for more information.
|
||||
|
||||
### Call the workflow
|
||||
|
||||
@@ -37,7 +37,7 @@ It covers everything from setup to usage and development. It is a work in progre
|
||||
|
||||
See an overview of n8n's developer resources.
|
||||
|
||||
[:octicons-arrow-right-24: Code in n8n](/code-examples/)
|
||||
[:octicons-arrow-right-24: Code in n8n](/code/)
|
||||
</div>
|
||||
|
||||
## About n8n
|
||||
|
||||
@@ -25,7 +25,7 @@ View [example workflows and related content](https://n8n.io/integrations/html/){
|
||||
|
||||
## Generate HTML template
|
||||
|
||||
Create an HTML template. This allows you to take data from your workflow and output it as HTML. You can use [Expressions](/code-examples/) in the template, including n8n's [Built-in methods and variables](/code/builtin/)
|
||||
Create an HTML template. This allows you to take data from your workflow and output it as HTML. You can use [Expressions](/code/understand-expressions/) in the template, including n8n's [Built-in methods and variables](/code/builtin/)
|
||||
|
||||
You can include:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ contentType: integration
|
||||
The *Respond to Webhook* node can be used in workflows with a [Webhook](/integrations/builtin/core-nodes/n8n-nodes-base.webhook/) node. It allows controlling the response to incoming webhooks. In the Webhook node, the **Using 'Respond to Webhook' node** option would need to be selected in the **Response** dropdown for the *Respond to Webhook* node to work.
|
||||
|
||||
!!! note "Expressions"
|
||||
When using [expressions](/code-examples/expressions/), the *Respond to Webhook* node will only run for the first item in the input data
|
||||
When using [expressions](/code/understand-expressions/), the *Respond to Webhook* node will only run for the first item in the input data
|
||||
|
||||
|
||||
## Node reference
|
||||
|
||||
@@ -140,7 +140,7 @@ When performing an operation on a specific record, such as "update a task commen
|
||||
* Wherever possible, provide two ways to specify a record:
|
||||
* By choosing from a pre-populated list. You can generate this list using the `loadOptions` parameter. Refer to [Base files](/integrations/creating-nodes/build/reference/node-base-files/) for more information.
|
||||
* By entering an ID.
|
||||
* Name the field `<Record name> name or ID`. For example, **Workspace Name or ID**. Add a tooltip saying "Choose a name from the list, or specify an ID using an expression." Link to n8n's [Expressions](/code-examples/expressions/) documentation.
|
||||
* Name the field `<Record name> name or ID`. For example, **Workspace Name or ID**. Add a tooltip saying "Choose a name from the list, or specify an ID using an expression." Link to n8n's [Expressions](/code/understand-expressions/) documentation.
|
||||
* Build your node so that it can handle users providing more information than required. For example:
|
||||
* If you need a relative path, handle the user pasting in the absolute path.
|
||||
* If the user needs to get an ID from a URL, handle the user pasting in the entire URL.
|
||||
|
||||
@@ -1953,7 +1953,7 @@ View the [commits](https://github.com/n8n-io/n8n/compare/n8n@0.210.1...n8n@0.210
|
||||
|
||||
#### Typeahead for expressions
|
||||
|
||||
When using [expressions](/code-examples/expressions/), n8n will now offer you suggestions as you type.
|
||||
When using [expressions](/code/understand-expressions/), n8n will now offer you suggestions as you type.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ Add a third node to message each customer and tell them their description. The C
|
||||
1. Select the **Add node** <span class="inline-image"></span> connector on the Set node.
|
||||
2. Search for **Customer Messenger**. n8n shows a list of nodes that match the search.
|
||||
3. Select **Customer Messenger (n8n training)** to add the node to the canvas. n8n opens the node automatically.
|
||||
4. You're going to use [expressions](/code-examples/expressions/) to map in the **Customer ID** and create the **Message**:
|
||||
4. You're going to use [expressions](/code/understand-expressions/) to map in the **Customer ID** and create the **Message**:
|
||||
1. Drag **customer_ID** from the **INPUT** panel into the **Customer ID** field in the node settings.
|
||||
2. Hover over **Message**. Select the **Expression** tab, then select the expand button <span class="inline-image"></span> to open the full expressions editor.
|
||||
3. Copy this expression into the editor:
|
||||
|
||||
34
mkdocs.yml
34
mkdocs.yml
@@ -579,13 +579,19 @@ nav:
|
||||
- Code node: code/code-node.md
|
||||
- Built in methods and variables:
|
||||
- code/builtin/index.md
|
||||
- Current node input: code/builtin/current-node-input.md
|
||||
- Output of other nodes: code/builtin/output-other-nodes.md
|
||||
- Date and time: code/builtin/date-time.md
|
||||
- n8n metadata: code/builtin/n8n-metadata.md
|
||||
- Convenience methods: code/builtin/convenience.md
|
||||
- Advanced: code/builtin/advanced.md
|
||||
- Data transformation functions:
|
||||
- code-examples/expressions/data-transformation-functions/index.md
|
||||
- Arrays: code-examples/expressions/data-transformation-functions/arrays.md
|
||||
- Dates: code-examples/expressions/data-transformation-functions/dates.md
|
||||
- Numbers: code-examples/expressions/data-transformation-functions/numbers.md
|
||||
- Objects: code-examples/expressions/data-transformation-functions/objects.md
|
||||
- Strings: code-examples/expressions/data-transformation-functions/strings.md
|
||||
- code/builtin/data-transformation-functions/index.md
|
||||
- Arrays: code/builtin/data-transformation-functions/arrays.md
|
||||
- Dates: code/builtin/data-transformation-functions/dates.md
|
||||
- Numbers: code/builtin/data-transformation-functions/numbers.md
|
||||
- Objects: code/builtin/data-transformation-functions/objects.md
|
||||
- Strings: code/builtin/data-transformation-functions/strings.md
|
||||
- Handling dates: code/luxon.md
|
||||
- Query JSON with JMESPath: code/jmespath.md
|
||||
- Generate code with ChatGPT: code/ai-code.md
|
||||
@@ -593,14 +599,14 @@ nav:
|
||||
- code/cookbook/index.md
|
||||
- Built-in methods and variables examples:
|
||||
- code/cookbook/builtin/index.md
|
||||
- evaluateExpression: code-examples/cookbook/builtin/evaluate-expression.md
|
||||
- execution: code-examples/cookbook/builtin/execution.md
|
||||
- getWorkflowStaticData: code-examples/cookbook/builtin/get-workflow-static-data.md
|
||||
- (node-name).item: code-examples/cookbook/builtin/node.md
|
||||
- (node-name).all: code-examples/cookbook/builtin/all.md
|
||||
- runIndex: code-examples/cookbook/builtin/run-index.md
|
||||
- vars: code-examples/cookbook/builtin/vars.md
|
||||
- workflow: code-examples/cookbook/builtin/workflow.md
|
||||
- evaluateExpression: code/cookbook/builtin/evaluate-expression.md
|
||||
- execution: code/cookbook/builtin/execution.md
|
||||
- getWorkflowStaticData: code/cookbook/builtin/get-workflow-static-data.md
|
||||
- (node-name).item: code/cookbook/builtin/node.md
|
||||
- (node-name).all: code/cookbook/builtin/all.md
|
||||
- runIndex: code/cookbook/builtin/run-index.md
|
||||
- vars: code/cookbook/builtin/vars.md
|
||||
- workflow: code/cookbook/builtin/workflow.md
|
||||
- Expressions:
|
||||
- code/cookbook/expressions/index.md
|
||||
- Check incoming data: code/cookbook/expressions/check-incoming-data.md
|
||||
|
||||
Reference in New Issue
Block a user