mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2026-03-27 09:28:43 +07:00
edits
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "return [\n{\n\"user_id\":\n\"53043\",\n\"username\":\n\"stevenn8n\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"72955\",\n\"username\":\n\"otoqitest\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"73022\",\n\"username\":\n\"muflih\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"73026\",\n\"username\":\n\"hkhjk\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"73028\",\n\"username\":\n\"nvmui\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"73031\",\n\"username\":\n\"ba144220\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"73032\",\n\"username\":\n\"tebe19\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"68765\",\n\"username\":\n\"wren\",\n\"date\":\n\"2023-08-09\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"70810\",\n\"username\":\n\"smrtr\",\n\"date\":\n\"2023-08-09\",\n\"variant\":\n\"variant\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"72435\",\n\"username\":\n\"socialdraft\",\n\"date\":\n\"2023-08-09\",\n\"variant\":\n\"variant\",\n\"data_exec_success\":\n\"FALSE\"\n}\n]"
|
||||
"jsCode": "return [\n{\n\"user_id\":\n\"0001\",\n\"username\":\n\"nathan\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"0002\",\n\"username\":\n\"natalie\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"TRUE\"\n},\n{\n\"user_id\":\n\"0003\",\n\"username\":\n\"nadia\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"naomi\",\n\"username\":\n\"hkhjk\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n},\n{\n\"user_id\":\n\"0005\",\n\"username\":\n\"nolan\",\n\"date\":\n\"2023-08-10\",\n\"variant\":\n\"control\",\n\"data_exec_success\":\n\"FALSE\"\n}\n]"
|
||||
},
|
||||
"id": "08e4d878-01ab-4f01-ab27-84ef5afbf581",
|
||||
"name": "Code",
|
||||
@@ -26,9 +26,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.json.myNewField = 1;\n}\n\nreturn $input.all();"
|
||||
},
|
||||
"parameters": {},
|
||||
"id": "57a9330b-9e46-42a6-b432-681e906de93a",
|
||||
"name": "Join items",
|
||||
"type": "n8n-nodes-base.code",
|
||||
@@ -62,18 +60,13 @@
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Join items": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
}
|
||||
},
|
||||
"active": false,
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "e90ee562-2afe-4700-9275-354bb57b39b8",
|
||||
"versionId": "d7409102-d3af-4ddf-bead-2df008554458",
|
||||
"id": "B4K5I5pN4nqu85ac",
|
||||
"meta": {
|
||||
"instanceId": "c5aabef739d71e3d0ceb8b6078a241aaf1b145fa71cbbe36ecfb2c8c3fd64f5f"
|
||||
|
||||
@@ -16,13 +16,15 @@ contentType: explanation
|
||||
|
||||
## Usage limits
|
||||
|
||||
During the trial phase there are no usage limits. If n8n makes the feature permanent, there will be usage limits as part of your pricing tier.
|
||||
During the trial phase there are no usage limits. If n8n makes the feature permanent, there may be usage limits as part of your pricing tier.
|
||||
|
||||
## Feature limits
|
||||
|
||||
The ChatGPT implementation in n8n has the following limitations:
|
||||
|
||||
* The AI writes code that manipulates data from the n8n workflow. You can't ask it to pull in data from other sources.
|
||||
* The AI doesn't know your data, just the schema, so you need to tell it things like how to find the data you want to extract, or how to check for null.
|
||||
* Nodes before the Code node must execute and deliver data to the Code node before you run your AI query.
|
||||
* Doesn't work with large incoming data schemas.
|
||||
* May have issues if there are a lot of nodes before the code node.
|
||||
|
||||
@@ -47,7 +49,7 @@ And some n8n-specific guidance:
|
||||
|
||||
### Example prompts
|
||||
|
||||
These examples show a range of possible prompts and tasks. They also demonstrate some of the instances where the AI is likely to return accurate code, and some where you'll need to edit.
|
||||
These examples show a range of possible prompts and tasks.
|
||||
|
||||
#### Example 1: Find a piece of data inside a second dataset
|
||||
|
||||
@@ -81,7 +83,7 @@ In the **Join items** Code node, enter this prompt:
|
||||
|
||||
> Return a single line of text that has all usernames listed with a comma. Each username should be enquoted with a double quotation mark.
|
||||
|
||||
Take a look at the code the AI generates. You may need to edit it to ensure the data it returns matches n8n's [data structure](/data/data-structure/).
|
||||
Take a look at the code the AI generates.
|
||||
|
||||
This is the JavaScript you need:
|
||||
|
||||
@@ -100,7 +102,7 @@ In the **Summarize** Code node, enter this prompt:
|
||||
|
||||
> Create a markdown text for Slack that summarizes how many ideas, features and bugs have been submitted. The type of submission is saved in the property_type field. Also, list the five top submissions by vote in that message. Use <link|message> as markdown for links.
|
||||
|
||||
Take a look at the code the AI generates. You'll probably need to edit this example to get it to work as intended.
|
||||
Take a look at the code the AI generates.
|
||||
|
||||
This is the JavaScript you need:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user