How do you create a new Notion database page for each item in Python array?

Hello everyone!

I’m trying to create a workflow which creates a new database page in Notion for each comic book where the title contains “The Amazing Spider-Man (2022)”. Using the Marvel API, I get around 5 results which I then store into an array that I return in Python. Using the Notion API, I use the ‘Create page from database’, to retrieve the array and store the data in a Notion table I created.

Here comes the problem: i’m using the Cover URL and Name to store the data from the array. But because I can only enter one path, it doesn’t loop trough all the items of the array. With the settings from the screenshot I only retrieve the first item of the array.

Does anyone know how I can loop trough this so that I can get the cover and title from each item in the array and create a page for them?

Thanks in advance!

Hi @EFaberos

First off, welcome to the Pipedream community. Happy to have you!

Adding better branching and iteration controls to the workflow builder is one of our top priorities.

Here’s a workaround you can use to split your workflow into two, so you have a second workflow that has the context of a single event.

That way you can use pre-built actions that accept one record at a time.