cancel
Showing results for 
Search instead for 
Did you mean: 

Error: The provided next page token is invalid or expired

antonyfm
Deputy Chef I
Deputy Chef I

I'm facing an issue when I run triggers that generate a CSV as output.
When I run the recipe, it throws the error that the Next Page Token is invalid or expired. Interestingly, the same recipe used to work earlier.

I'm finding this issue when I use triggers like: Export new/updated issues in Jira which generates output as a CSV file.

I'm not able to use Logger or CSV tools to figure out if there is any issue causing this.
Has anyone run into a similar problem, please let me know.

Thanks

2 REPLIES 2

Obugari
Deputy Chef III
Deputy Chef III

The issue you're facing is related to pagination,  we can’t apply pagination directly inside a trigger step. As a workaround, if it’s okay for your use case, you can use a scheduler to run the recipe at shorter intervals. Then, inside the recipe:

  • Use a "while loop" to handle pagination.

  • In the first loop, create a list to store results.

  • Make a Jira call (or HTTP call).

  • On the next loop, call Jira again using the Next Page Token and add the results to the same list created earlier.

  • Use the loop condition as “Next Page Token is present” — so it keeps looping until there’s no token left.

For reference, I’ve attached a screenshot showing this setup. I used an HTTP call, but in your case, you can use the Jira action instead.pagination2.png

Thankyou

Himaja
Deputy Chef II
Deputy Chef II

Hi @antonyfm,

 

  • Restart the Recipe: Stop the recipe and restart it to reset the token.

  • Use Timestamp Pagination: If available, switch to timestamp-based pagination, update_at

  • Reduce Trigger Interval: Run the trigger more frequently (e.g., every 5–10 mins) to avoid token expiry.

  • Check CSV Output: Add a logger before the CSV step to inspect data. Try building CSV manually using Search + Repeat.

  • Disable Pagination (if possible): For small datasets, test without pagination.