Schedule a Workspace to Run with FME Flow Automations

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2023.0

Introduction

Welcome to the third tutorial of the Getting Started with FME Flow (formerly FME Server) series. In this tutorial, we will create an automation to run a workspace on a schedule and then manually trigger it for testing purposes. 
 

Step-by-Step Instructions

1. Upload Workspace to FME Flow
If you have not completed the previous tutorial, please download the CreatingParametersForSelfServe.zip which contains the AddressesToNotify-SelfServe.fmwt workspace from the Files section on this article. Then upload the workspace to the Resources in FME Flow before continuing. If you do not have access to FME Form (formerly FME Desktop), please see the Uploading to FME Flow section of the documentation. 

2. Create a New Automation
Open the FME Flow Web Interface and log in. On the side menu bar, click on Automations to expand the menu, then select Create Automation (FME 2022.2 or older: Build Automation).
CreateAutomation.png

In Automations, a quick introduction will pop up; review it before closing. 
LearnAutomations.png

After closing the Get Started dialog, you’ll be on the Automation canvas with a Trigger component already added, as well as Next Action guides. 
AutomationCanvas.png
The canvas is where Triggers, Actions, and other components will be added to create an Automation workflow, similar to an FME workspace. For an in-depth look at automations, see Getting Started with Automations.

The Next Action guides will be used in the next step to quickly add and configure action components. The guides can be disabled by opening the Menu and selecting Hide Guides, if desired. 
 
3. Set up a Schedule Trigger
Since the Trigger has already been added to the canvas, double-click on it to modify the details. 
ClickTrigger.png

In the Trigger Details dialog, click the drop-down to expand the trigger options, select FME Flow Schedule (Initiated) (FME 2022.2 or older: FME Server Schedule (Initiated)). After selecting a trigger type, more options will appear. 
SelectSchedule.png 

For this schedule, we want it to run once daily at the same time. Set up the Schedule Details as follows:

  • Schedule Type:  Repeat on Interval 
  • Repeat Every: 1 Day
  • Start Immediately: Enabled (this will set the schedule time to the time the automation is turned on. For a specific time, set the Start instead of enabling Start Immediately)
  • End: <set to one week from today>

Click Apply. 
ScheduleParams.png

4. Add and Configure an Action
With the Schedule Trigger setup, we need to set up an action to trigger. Double-click on the silhouetted Next Action Guide connected to the success output port (the one with the checkmark); this will open the Next Action Details.
NextAction.png

If Guides are disabled, click on the orange plus sign (+) in the bottom left corner to open the menu (1). Next, click on Action to select it (2), then click on the canvas to add the Action component. To connect the newly added Action component, click on the FME Flow Schedule component success port (checkmark) and drag the connection line to the Action input port.
AddAction.pngActionConnection.png


In the Next Action Details, select Run a Workspace from the drop-down menu. After selecting an action type, the dialog will update with more options. 

Set the Action Details as follows:

  • Repository: Flow Training
  • Workspace: AddressesToNotify-SelfServe.fmw

Workspace.png

The Parameters will need to be modified as well. Click on the ellipsis [...] next to Service Area Input Shapefile Data to open the file browser.
UpdateServiceAreas.png

Navigate to Data > Flow Training and add the water_service_areas_updated.zip by clicking the green plus sign (1). This dataset was uploaded in the previous tutorial. If you do not have this dataset already uploaded, please see Part 2 of the previous tutorial. Next, remove the $(FME_MF_DIR)water_service_area.shp default dataset by clicking the x (2). Click OK to add the dataset to the parameter. 
SelectFile.png

Then select a date for Date of Water Service, it can be sometime in the future. Finally, click on the ellipsis for the Destination Microsoft Excel File and browse to the Flow Training folder. In the lower address bar, after $FME_SHAREDRESOURCE_DATA)/Flow Training/ type in: 

AddressesToNotify_updated.xlsx 

OutputExcel.png

Click OK, then once the parameters are all set, click Apply. 

RunWorkspace.png

5. Save and Start Automation
This automation is simple but very powerful as it allows a workspace to be run daily without the user needing to do anything beyond setting up the automation. Before the schedule is initiated, the automation needs to be saved and started.

Click on the Start Automation button in the top right corner. 
StartAutomation.png

Since this is the first time we are starting the automation, we will be prompted to save. Save the automation as Schedule Addresses To Notify, and click the plus sign to add a Tag. Input a tag name of Flow Training and then click OK twice to save the automation.
SaveAs.png

Note: If you only have the single Flow Training tag, Select All will be enabled. If your FME Flow has other tags besides the newly created Flow Training tag, Select All will remain disabled. 

After saving the automation, the automation will start. To make any edits, the automation will need to be stopped. 
StopAutomation.png 

6. Verify that the Workspace Runs Successfully
Since Start Immediately is enabled in the Schedule component, AddressesToNotify-SelfServe.fmw started running when Start Automation was clicked. There are two ways to check the status of your automation and its triggered jobs.
 
a. View the Job Log
From the Automation page, click Menu > View Triggered Jobs. A list of jobs run by this automation appears. These jobs can also be accessed by going to Jobs > Completed. You will know the job is from the automation because it will have the Source Type listed as Automations and the name of the automation. 
Jobs.png

b. View the Automation Log File
The second way to see if the automation was successful is by viewing the log files. These files can be accessed by going to Menu > View Log File while in the automation.
Log.png

7. Trigger a Schedule
When we set up our schedule, we enabled Run Immediately, which caused the automation to kick off once we started it, and then it will repeat every day at the same time as when we started the automation. But what if we needed a new copy of the AddressesToNotify_updated.xlsx Excel spreadsheet, but the automation isn’t going to run for a few more hours based on the schedule? We can manually trigger the schedule. This option is also great for testing, so you don’t need to keep modifying the scheduled start time or if you have your schedule configured to run in off-hours. 
 
Once the automation has been started, if you double-click on the Schedule component to open the parameters (1), a Trigger button will appear at the bottom. You can’t modify any of the parameters because the automation is running, but you can trigger it to initiate the schedule (2). 
Trigger.png


 

Continue Your FME Journey  

 

Interested in exploring another practical example similar to this tutorial?

 

Want to continue learning FME Flow basics?

  • The FME Academy is a guided, on-demand way to learn the entire FME Platform, and it's FREE! 

 

Interested in data integration and workspace authoring?

 

Have a specific question?

Data Attribution 

The data used here originates from data made available by the City of Surrey, British Columbia. It contains information licensed under the Open Government License - Surrey.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.