Creating Looping workflows within FME Flow Automations

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

Looping in FME Flow Automations enhances the functionality of automations by allowing FME Flow users to re-run actions that have failed (due to external factors) and create advanced ‘Process Manager’ integrations. 

Enabling loops in automations is an advanced feature. Take care to avoid creating an infinite loop that could overload your server's engines. Creating a loop upstream of a merge node is also not recommended and may lead to unexpected behavior.

​​​​​​Examples of Looping

Creating a loop in an automation workflow will be useful when users want to retry actions if they fail. Two examples of looping scenarios are:

Resubmitting Failed Jobs

Workspaces may fail because external data sources can't handle concurrent connections or experience network interruptions. If the workspace fails, you can reconnect it to the input port to try again. (Note: if the failure is due to another reason, an endless loop may occur). Build logic into the workspace to handle retries, or use the automations Writer to control when a workspace might loop.

image.png

Re-trying HTTP Actions

The HTTP Request action gives the following output attributes (formerly output keys): Error Type, Error Message, Status Code, Response Headers, and Response Body. You can use the Filter action after a failed HTTP Request to decide whether to loop. For example, if the returned Status Code was a 503 Service Unavailable (or any other applicable status code) loop it back, with the intention that when the service becomes available the HTTP Request will succeed. You may want to consider running the HTTP request in a workspace where you can add logic to avoid looping for too long.

image.png

Step-by-step Instructions

Part 1: Create a Simple Looping Automation

Scenario

Using the FAA National Airspace System (NAS) Status API, send a scheduled email with delay information. Create an automation loop to retry the API call if it fails to retrieve data. The API returns data for all airports currently experiencing delays or closures in a single XML response, covering ground delays and airport closures.

1. Enable Automations Looping

Import the Simple_Looping2026.fsproject to FME Flow, then open the Airport Delay Tracker automation. 
To use Looping, enable it from the Automations Menu dropdown. After selecting ‘Enable Looping’, read the warning message and select ‘Enable Loops’. Looping lets you connect downstream output ports to upstream input ports. 

image.png

2. Add Workspace to the Automation

Connect the airportstatus.fmw workspace to the success port of the FME Flow Schedule.

Because the NAS Status API reports on all currently affected airports in one call rather than accepting a single-airport query parameter, this version of the workspace does not filter to one airport. Instead, it reads the full feed and splits results into two categories:

  • Ground Delays — airports with an active ground delay program
  • Airport Closures — airports with an active closure

Connect the Closures output port to the Email action and the Delays port to the Log action. Configure the Email action. 

3. Add Loop

The airportstatus.fmw workspace is configured to terminate and fail only if an error occurs while pulling data from the API call. This means that if there are no active delays or closures, the workspace will still succeed even if it doesn't output any features.

To retry in case of an error, run the workspace and make the API call again by clicking and dragging the airportstatus.fmw failure port to its input port. 

The dashed gray line shows a looping scenario, which occurs when the workspace fails in this simple example. 

4. Start Automation

Save the automation and then select Start Automation.

Part 2: Create an Advanced Looping Scenario

Adding looping capability to FME Flow Automations allows users to create more complex looping workflows that resemble a ‘Process Manager’ Enterprise Integration Pattern. A Process Manager is an Integration Pattern (for more information on Integration Patterns, see this article) that relies on a central processing unit to dynamically route tasks or messages to different ‘processing units’ (workspaces), without having a sequence or processing order predefined. 

A Process Manager is an Integration Pattern (for more information on Integration Patterns, see this article) which relies on a central processing unit to dynamically route tasks or messages to different ‘processing units’ (workspaces), without having a sequence or processing order predefined. This central processing unit needs a memory mechanism that stores which step in the sequence was executed last.

Scenario

Create a looping automation that mimics spending a day at FME Amusements going on rides, playing games, and eating snacks until the money runs out. Uploading the FME Amusements Tracker.xlsx file into a watched directory triggers the automation, which flows through the Ticket Booth, Amusement Activities, and Check Wallet workspaces. 

The Ticket Booth workspace purchases tickets, 10 tickets maximum at a time, for a cost of $0.50 per ticket. The Amusement Activities workspace deducts 3 tickets and lets the participant go on an amusement ride, play a carnival game, or get food (chosen at random), and records the activity on the spreadsheet. 

The Check Wallet workspace tests whether the participant has enough tickets to do more activities, needs to go to the ticket booth to get more tickets, or doesn’t have enough money to continue, and ends the day at FME Amusements.

1. Prepare Automation for Looping

Import the Advanced Looping.fsproject (built with FME Flow 2023.0), then open the FME Amusements automation. Enable Looping for the automation (see Part 1, Step 1). 

2. Add Loops

Currently, the automation is set up so that a trip to FME Amusements consists of visiting the ticket booth, doing one activity that costs 3 tickets, and checking for money and tickets before ending. Adding loops to the automation allows participants to buy more tickets and complete more activities. 

The Check Wallet workspace directs the automation flow based on how much money and how many tickets the participant has left. Use the Continue Activities port if there are enough tickets to complete another activity, and use the Need More Tickets port if there aren’t enough tickets to do an activity but there’s enough money to buy tickets to do another activity. Use the Days Over port when you don’t have enough money or tickets to do any more activities. 

Connect the Continue Activities output port to the input port of the Amusement Activities workspace action to create a loop.

image.png

Next, connect the Need More Tickets output port to the Ticket Booth input port to create the next loop and complete the process. 

image.png

Save and start the automation.

3. Run the Automation

Create or modify the FME Amusements Tracker.xlsx file in the directory the trigger watches to ensure the FME Amusements participant has money to spend at FME Amusements. The default directory being watched is $(FME_SHAREDRESOURCE_DATA)/FME Amusements Data.

image.png

This will trigger the automation to run, repeating through the workspaces until there are not enough tickets or money. The automation log file will record each workspace run, which will occur multiple times. 
After completion, the original file will be overwritten to show the current money and ticket amounts and the random activities completed at FME Amusements. 

image.png

If you no longer need looping functionality for your automation, select Disable Looping from the automation Menu to prevent unwanted continuous loops from being created. 

Data Attribution

The data used in this article comes from the Federal Aviation Administration's National Airspace System (NAS) Status API. Confirm current licensing terms for this API before republishing.

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.