I have a method that works around this issue. This approach ensures that you can manage long-running workflows effectively by leveraging polling and execution status checks.
Here’s a quick summary:
- Call the webhook and immediately respond with the execution ID.
- Store the execution ID in your Pip function.
- Poll the n8n API every 5 seconds to check the execution status using the endpoint:
https://www.n8n/api/v1/{execution_id}?includeData=false
. - Once the execution status is
"finished": true
, fetch the full execution data using:https://www.n8n/api/v1/{execution_id}?includeData=true
. - Extract the data from the last node, which you can easily identify if you name it “lastNode”.
This way, you can handle long-running tasks without backend timeout issues.
Hope this helps !