![recursive-flow icon](/docs/img/components/icons/60/cmVjdXJzaXZlLWZsb3c=.png)

# Recursive Flow Connector

key: recursive-flow[Connector Changelog](#changelog)

## Description[​](#description "Direct link to Description")

The recursive flow component allows a flow to recursively call itself. It is particularly useful if you have a long-running workflow that needs to process logs of records.

A `cursor` is passed between executions to track what data has been processed, and what data is left to process.

For example, suppose you have 100,000 records in a third-party app to process. You know from experience that you can fetch 100 records at a time, and that each page of records takes about 5 seconds to fetch and process. Processing all of the data would take 5 seconds x 1000 pages (or about 83 minutes).

An execution can run for a [maximum of 15 minutes](https://prismatic.io/docs/integrations/integration-runner-environment-limits.md#execution-time-limitations), so you won't be able to process all pages in a single execution. Instead, you can process a hand-full of pages in one execution, and then invoke another execution with a cursor indicating where you left off.

In the 100,000 records / 5 seconds per page example, you could build your to flow process, say, 10 pages per execution. After 10 pages (or about 50 seconds; well under the 15-minute limit), it could call itself with a cursor of `11`. The next execution would process pages 11 through 20, and send itself a cursor of `21`. This could continue until you detect that there are no more records to process.

A general flow that processes large sets of records from a paginated API in serial using the recursive flow trigger would look something like this:

## Triggers[​](#triggers "Direct link to Triggers")

### Recursive Trigger[​](#recursivetrigger "Direct link to Recursive Trigger")

Accept a request from an 'Invoke Recursive Trigger' step | **key: recursiveTrigger**

| Input                | Notes                                                                                                                                                                                                                                          | Example              |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
| Default Cursor Value | The default value to return as a cursor if no cursor was supplied in a trigger payload. For example, you could set this to '1970-01-01T00:00:00Z' (Unix Epoch) if your cursor is a creation timestamp, or '0' if your cursor is a page number. | 1970-01-01T00:00:00Z |
| Run on Deploy?       | Run this flow automatically when an instance is deployed.                                                                                                                                                                                      | false                |

When invoked manually or via webhook without a cursor value, the recursive trigger begins an execution using the **Default Cursor** input as its current cursor value. If the API you're integrating with uses page numbers, you can set the default cursor value to `0`. If you're using timestamps, Unix Epoch (`1970-01-01T00:00:00Z`) could work for an initial cursor.

When invoked by an [Invoke Recursive Trigger](#invokerecursive) action, a cursor is passed to this trigger via POST request and is used for the current execution.

***

## Actions[​](#actions "Direct link to Actions")

### Get Recursive Cursor[​](#getcursor "Direct link to Get Recursive Cursor")

Get the current value of the recursive trigger cursor | **key: getCursor**

<!-- -->

***

### Invoke Recursive Trigger[​](#invokerecursive "Direct link to Invoke Recursive Trigger")

Invoke the current flow with the current cursor | **key: invokeRecursive**

<!-- -->

***

### Set Recursive Cursor[​](#setcursor "Direct link to Set Recursive Cursor")

Set the value of the recursive cursor for the next loop iteration or recursive trigger invocation | **key: setCursor**

| Input  | Notes                                                                                       | Example |
| ------ | ------------------------------------------------------------------------------------------- | ------- |
| Cursor | The programmatic cursor to set for the next loop iteration or recursive trigger invocation. |         |

***

## Changelog[​](#changelog "Direct link to Changelog")

### 2025-11-14[​](#2025-11-14 "Direct link to 2025-11-14")

Enhanced the trigger to utilize default cursor values for situations where the trigger is invoked by a webhook request with no body or by a schedule.
