I’m encountering a situation in n8n where my input data is disappearing after using certain nodes, especially with HTTP requests. It’s critical to keep specific fields from the input, such as IDs, since I need them for later operations like merging data.
This results in loss of the prospect_id and user_email, which I require in the following steps. Is there a method to ensure both the original input and the new response data are accessible for later processing?
here’s another tip: try using a merge node after your http request. split the flow first - one path keeps your original data, while the other deals with the api call. then merge them back to ensure you have everything for later processing.
I have encountered similar challenges in n8n when handling input data. A reliable approach is to use a Set node before making your HTTP requests to retain the essential data fields like prospect_id and user_email. By selecting ‘Keep Only Defined Fields’, you can ensure that these fields are preserved along with your obtained API response. Additionally, consider structuring your HTTP request to send the original data back in the response. This strategy helps maintain continuity when the downstream service does not return these identifiers. For more complicated scenarios, employing a Function node to merge objects can be effective, but the Set node often suffices for most straightforward applications.
Here’s what worked for me - use a Code node to manually save your input data. I hit this same problem and wrote a quick JavaScript snippet that stores the original payload in a variable before the HTTP request runs. Once you get the API response back, just combine both datasets in the same Code node. You get full control over how the data’s structured and don’t need a bunch of nodes chained together. This approach is great when you need to transform the combined data right away - you can preserve and manipulate everything in one shot instead of spreading your workflow across multiple nodes.