I have a workflow that starts with a webhook trigger, receiving a POST request containing a JSON payload. The payload includes:
- An
emailfield - An
agreementsarray
My goal is to iterate over the agreements array and send an email for each item. To achieve this, I configured a Loop step with a batch size equal to the length of the agreements array.
However, I encountered an issue: the Loop step does not expose the current iteration index in its output. This makes it impossible to determine which element of the original array is being processed in each iteration.
This limitation becomes problematic in the subsequent steps:
- A Code step is used to download a PDF file from a presigned URL found in each agreement.
- A Send Email step follows, which combines the original webhook data with the downloaded attachment to send an email.
Without access to the current index, there’s no reliable way to reference the correct agreement object in the original array, which breaks the intended logic of the workflow.
Expected Behavior:
The Loop step should expose the current iteration index (e.g., currentIndex) as part of its output, so it can be used in downstream nodes to correctly reference items in the original input array.
Any help is appreciated.
I’ve tried asking the assistant but it caused an error (see attachment)
