Declarative-style parameters#
These are the parameters available for node base file of declarative-style nodes.
This document gives short code snippets to help understand the code structure and concepts. For a full walk-through of building a node, including real-world code examples, refer to Build a declarative-style node.
Refer to Standard parameters for parameters available to all nodes.
methods
and loadOptions
#
Object | Optional
methods
contains the loadOptions
object. You can use loadOptions
to query the service to get user-specific settings, then return them and render them in the GUI so the user can include them in subsequent queries. The object must include routing information for how to query the service, and output settings that define how to handle the returned options. For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
routing
#
Object | Required
routing
is an object used within an options
array in operations and input field objects. It contains the details of an API call.
The code example below comes from the Declarative-style tutorial. It sets up an integration with a NASA API. It shows how to use requestDefaults
to set up the basic API call details, and routing
to add information for each operation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
version
#
Number or Array | Optional
If you have one version of your node, this can be a number. If you want to support more than one version, turn this into an array, containing numbers for each node version.
n8n supports two methods of node versioning, but declarative-style nodes must use the light versioning approach. Refer to Node versioning for more information.