mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-28 07:17:04 +02:00
37 lines
1.9 KiB
JSON
37 lines
1.9 KiB
JSON
{
|
|
"conversation": [
|
|
{
|
|
"role": "user",
|
|
"text": "Every day fetch a post from JSONPlaceholder and add two fields to it before passing it on."
|
|
},
|
|
{
|
|
"role": "assistant",
|
|
"text": "Which post, and which two fields?"
|
|
},
|
|
{
|
|
"role": "user",
|
|
"text": "GET https://jsonplaceholder.typicode.com/posts/1. Add `caption` from the post title, and `source` with the literal value 'jsonplaceholder'. Keep all the original fields too."
|
|
},
|
|
{
|
|
"role": "assistant",
|
|
"text": "Plan: schedule daily → HTTP GET the post → Code node to compose the new object with caption, source, and the original fields preserved. Sound good?"
|
|
},
|
|
{
|
|
"role": "user",
|
|
"text": "No Code node — use Edit Fields (Set). That's exactly what it's for. Preserve original fields via the includeOtherFields option, not by manually re-mapping them."
|
|
}
|
|
],
|
|
"messageBudget": 6,
|
|
"complexity": "medium",
|
|
"tags": ["build", "schedule", "http-request", "set", "data-transformation"],
|
|
"triggerType": "schedule",
|
|
"executionScenarios": [
|
|
{
|
|
"name": "preserve-fields",
|
|
"description": "HTTP data is reshaped with Set/Edit Fields while preserving the original response fields",
|
|
"dataSetup": "The HTTP Request node returns a single JSON object with id=42, userId=7, title='Launch day', and body='Ship it'.",
|
|
"successCriteria": "The workflow executes without errors. Judge the executed output values, not whether Set node parameters are literal or expression strings. The data reshaping is done with an Edit Fields/Set node, not a Code node. The final executed output contains the original id, userId, title, and body fields, plus caption resolving to 'Launch day' and source resolving to 'jsonplaceholder'. The Set/Edit Fields node uses mode='manual', valid manual assignments, and includeOtherFields=true to preserve existing input fields; it must not use keepAllExistingFields as a mode or manually re-map every original field as a substitute for includeOtherFields."
|
|
}
|
|
]
|
|
}
|