Set up an extraction using FME Flow (Server)
Info
This tutorial uses the extraction plugin Extraction FME Flow (Version 2) which allows unlimited parameters length, thus allowing request with precise geometries like municipalities boundary.
To follow along with this tutorial, download the sample script and data available here. Either by cloning the repo :
git clone https://github.com/asit-asso/extraction-samples.git
Or downloading a ZIP archive with the following link : https://github.com/asit-asso/extraction-samples/archive/refs/heads/main.zip
Set up the FME workspace inside FME Flow
-
In the downloaded folder, go to the subfolder
fmeand open up thesample-script-FME2024.fmwFME workspace. This tutorial uses the same workspace as the previous tutorial for FME Form. -
First, we need to uncheck the
requiredoption of theparametersFileUser Parameter in order to let FME Flow override theparameters.json.
-
Then, connect to your FME Flow instance.

-
Next, publish the workspace to FME Flow

Choose a valid FME Flow connection and create a new repository where to publish the workspace, e.g.
extractor use an existing one.
-
Make sure the
Upload data filesoption is checked ans select only theswissTLMRegio_Buildings_2056.zipfile. Indeed, the latter is our business data to be extracted and must be uploaded to FME Flow. But theparameters.jsonfile can be omitted since the parameters will be overridden by theFME Data Downloadbody request (see below).
-
The
Extraction FME Flow (Version 2)plugin sends all request parameters encoded as aGeoJSONthrough the body of theFME Data DownloadPOST request. To tell FME to use the request's body as GeoJSON input for theFeatureReader, we need to do the following :- In the last dialog, select the
Data DownloadService. - Click on the edit button and under
Send HTTP Message Body to Reader, select the GeoJSON Reader (in our case, this is theFeatureReader"Read_Parameters"). -
Under
Writers in Download, select all available writers. Therefore, data outputted in all formats will be available in the Data Download Service response.
- In the last dialog, select the
-
Once we have uploaded the workspace and the necessary data to FME Flow, we need to create an API token to authenticate the request that will be posted by Extract.
In FME Flow, under Workspaces, go to your extract repository. Select the corresponding workspace (
sample-script-FME2024.fmwin our example). Under theAdvancedtab, click onCreate a Webhook.
In the next dialog, make sure the
User Can Uploadoption is checked and click onCreate.In the next dialog, click on
Download Webhook. This will download a text file with the URL to call the request and the API token to authenticate it. This is the only chance you get to retrieve these information !
-
In the downloaded text file, write down the URL to call the
FME Data Download Servicewithout the query parameters and the API token.
Connect the workspace to Extract
-
In Extract, create a new or use an existing process (see processes).
-
Drag and drop the task plugin
Extraction FME Flow (Version 2)into the process task list. -
In the field
URL du service FME Server Data Download, type the URL of your service. In the fieldToken API FME, type the API token.
-
To test the extraction, you can link this process to viageo (see Connect Extract to viageo.ch). With our example, the linked resource can be orderable over the entire Switzerland in the following format :
shapefile,geopackage,GeoJSONandDXF. -
Finally, you can order the linked product on viageo, Extract will retrieve the request and run the FME workspace by calling the FME Flow Data Download Service with all request parameters carried out in API request's body.