Block 1 - When clicking ‘Test workflow’
- Type / Role
- n8n-nodes-base.manualTrigger - manualTrigger
- Config choices
- Version 1
This workflow is provided as-is. Please review and test before using in production.
Extract a key–value pair by index from JSON to fields in n8n This template takes a JSON object and a row index and returns exactly one key–value pair at that index. It’s a handy helper when you onl...
n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.code
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by WeblineIndia.
Original n8n.io sourceThis template takes a JSON object and a row index and returns exactly one key–value pair at that index. It’s a handy helper when you only need a single entry from a structured JSON payload (e.g., picking one form field for downstream logic).
When clicking ‘Test workflow’) starts the flow.myData: an object of key → value pairs.rowIndex: a 0‑based index indicating which pair to extract.myData and returns [key, value] at rowIndex as result.result[0] to a field named result.result[1] to a field named result[1].{
"myData": { "name": "Alice", "age": "30", "city": "Paris" },
"rowIndex": "1"
}
myData: object with keys/valuesrowIndex: integer (0‑based){ "key": ..., "value": ... } or write directly to next‑node fields.rowIndex, non‑object myData, or empty objects.myData is an object and rowIndex is numeric.| Issue | Possible Cause | Solution |
|---|---|---|
| “Index out of range” | rowIndex is larger than the number of keys |
Use a valid 0‑based index; add a guard in the Code node to clamp or default. |
| Wrong key returned | Object key order differs from expectations | Object key order isn’t guaranteed across sources—prefer pick by key name for reliability. |
| Empty/invalid output | myData is not an object or is empty |
Ensure myData is a flat object with at least one key. |
| Python errors | Code node’s Python runtime not available | Enable Python in the Code node or convert the snippet to JavaScript. |
| Value type mismatch | Value isn’t a string | Cast as needed in the Set node or normalize types in the Code node. |
If you’d like this to pick by key, handle nested JSON, accept data via Webhook or fully customized to your needs, write to us and we’ll adapt the template to your exact use case.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | JSON data utility: extract key-value pairs by index |
|---|---|
| Complexity | intermediate |
| Nodes | 5 |
| Categories | Engineering |
| Author | WeblineIndia |
| Published | 29 Jul 2025 |
Use the JSON export at /data/workflows/6615/6615.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
Extract a key–value pair by index from JSON to fields in n8n This template takes a JSON object and a row index and returns exactly one key–value pair at that index. It’s a handy helper when you onl...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering use case.