Files
Introduction
In Part 1 of this series, you learned how to create an Agentic AI Schema Mapping workspace that dynamically builds a lookup table based on a desired output schema—no matter the structure of the incoming data.
In this article, you’ll take the next step by learning how to apply the lookup table generated by the Agentic AI Schema Mapping workspace.
Requirements
- FME Workbench 2025.0 or later.
- Access to an OpenAI API Key OR another AI Service such as Google Gemini, Amazon Bedrock, Azure AI Foundry, etc.
- Completed Part 1 in this article series.
Step-by-step Instructions
Applying the Lookup Table
1. Add a Generic FeatureReader
Open FME Workbench and continue with your workspace from Part 1 of this series.
Add a FeatureReader to the workspace and set the parameters as follows:
- Format: Generic (Any Format)
-
Dataset: click the drop-down arrow > User Parameter > select SourceDataset_GENERIC
- While adding a second generic reader may seem redundant, a separate reader instance is required to enforce the correct order of operations. It ensures the mapping file is fully generated before the workflow attempts to read and map the records.
- Output Ports > Single Output Port - <Generic>
Click OK to accept the new parameters.
2. Add a SchemaMapper
Add a SchemaMapper transformer to the workspace and connect it to the Generic Reader. Open the SchemaMapper parameters and set them as follows:
- Format: CSV (Comma Separate Value)
- Dataset: select the CSV lookup table you generated from Part 1 of this article series. If you don’t have a CSV file, make sure you have completed Part 1 correctly and run your workspace.
Click Next. In the next dialog, select the plus button > Attribute Map
- Source Attribute Field: SOURCE
- Destination Attribute Field: DESTINATION
- Source Attribute: Remove
Click OK. Then click Finish to finalize the parameters.
3. Configure the Lookup Table Path
Next, we need to create a user parameter to pass the location of the lookup table created by AI and written out by the FeatureWriter to the SchemaMapper.
Open the User Parameter Manager. Create a new Text parameter. Set the parameters as follows:
- Parameter Identifier: LUTPATH
- Disable “Show Label”
- Visibility: Always Hide
-
Default Value:
$(LUT_Output)/lookuptable.csv
Click OK to close the User Parameter Manager.
In the navigator window, expand the Transformers section, expand the SchemaMapper, and then expand the Parameters.
Right-click on the Dataset parameter and then select Link to a Parameter…
In the Link to a Parameter dialog that appears, select the LUTPATH parameter you just created. Click OK.
4. Add an AttributeRemover
We need to remove an attribute created by the SchemaMapper. Add an AttributeRemover to the workspace and connect it to the SchemaMapper “Mapped” output port.
Open the parameters and set them as follows:
- Attributes to Remove: _schemamapper_row_ids
Click OK to accept the parameters.
4. Add a SchemaScanner
We’ve made some changes to our data since reading in our dataset with the FeatureReader. The SchemaScanner will create a clean & up-to-date schema that we can use for the Dynamic writer in the next step.
Add a SchemaScanner and connect it to the AttributeRemover. Use the default parameters for the SchemaScanner.
5. Add a GeoJSON FeatureWriter
Before adding the FeatureWriter, we need to create a User Parameter that allows the user to specify a folder for outputting the mapped dataset.
In the Navigator window, right-click on User Parameters and select Manage User Parameters. Add a new File/Folder/URL parameter. Set the parameters as follows:
- Parameter Identifier: Mapped_Output
- Label: Mapped Dataset Output Folder
- Visibility: Always Show
- Items to Select: Folders
- Access Mode: Write
Lastly, we will add a writer to format the text as we want it to be written. In this case, we will write to a GeoJSON file.
Add a FeatureWriter transformer to the workspace. Connect both the SchemaScanner Output and <Schema> output ports to the FeatureWriter. Open the FeatureWriter parameters and set them as follows:
- Format: GeoJSON (Geographic JavaScript Object Notation)
-
Dataset:
$(Mapped_Output)/mapped_dataset.json
Next, enable Dynamic Schema Definition and set the parameters below as follows:
- Schema Sources: “Schema From Schema Feature”
- Schema Definition Name: fme_feature_type_name
Go to the User Attributes tab and remove any attributes that are present. This will prevent additional attributes from being written to the output.
Click OK to accept the new parameters. Your workspace should now resemble this.
6. Test the Workspace
Now that the workspace is ready, we can run it with some test data to ensure that it functions correctly.
Run the workspace and when prompted, provide the Source Dataset, the Lookup Table, and the Mapped Dataset Output Folder.
After finishing, navigate to the output folder and inspect the resulting GeoJSON file. You can open the file in FME Data Inspector to verify that the schema has been mapped correctly.
Conclusion
By applying the lookup table dynamically, you have solved the challenge of variable data schemas. You now have a complete workflow that ingests data, consults an AI agent to understand the structure, and maps it to your standard automatically.
This approach significantly reduces data preparation time and ensures your repository remains consistent, regardless of the source format.