Introduction
Reviewing field asset inspections can be a slow and manual process. Inspectors submit ratings, notes, and photos, which need to be checked for accuracy, completeness, and consistency. This review step can be tedious, especially with high inspection volumes. When done manually, mistakes can easily slip through. For example, a critical asset is quietly rated as satisfactory, or a condition mismatch goes unnoticed until it's too late. AI can act as a second set of eyes, automatically catching these discrepancies and cross-checking so human reviewers can focus their attention where it's actually needed.
This article walks through a workflow that uses FME Form, FME Flow, webhooks, and AI services to automate quality assurance (QA) for field asset inspections. By integrating ArcGIS Survey123 with FME Flow, incoming inspection data can be automatically enriched with AI-derived condition assessments, flagged for potential issues, written to a database, and summarized in a weekly PDF report for easy human review.
These prerequisite articles are recommended for background reading before working through this article:
- Push Data from ArcGIS Survey123 to an Application in Real-time with Webhooks
- Getting Started With Document PDF Writing
Requirements
As per Push Data from ArcGIS Survey123 to an Application in Real-time with Webhooks:
- You will need an ArcGIS Online account registered with a minimum Creator user type to access Survey123. We are assuming you have already set up a survey form in Survey123.
- You will also need to make your FME Flow publicly accessible if it isn’t already, or, at minimum, anyone submitting the survey must be on the same network as the FME Flow server and have FME Flow configured for HTTPS/SSL.
You will also need:
- An AI service account with a supported AI vision provider (for example, Google Gemini or AzureAIVisionConnector). API usage fees may apply depending on your provider. See FME Hub for AI vision connector custom transformers.
Step-by-Step Instructions
This article is divided into two main parts.
Part 1 covers the real-time webhook pipeline that receives Survey123 submissions, enriches the data using AI, and writes results to a database.
Part 2 covers creating the scheduled PDF report that summarizes inspections for human review.
Part 1: Survey123 Webhook workflow
In this section, we will build a real-time pipeline using an FME Flow Automation and an ArcGIS Survey123 webhook. When an inspector submits a form, Survey123 sends the payload to FME Flow, which will trigger an FME Form workspace. That workspace parses the submission, sends any attached photos to an AI vision service for condition assessment, flags potential data quality issues, and writes the enriched record to a database.
1. Set Up the FME Flow Automation and Survey123 Webhook
The first step in this workflow is to connect ArcGIS Survey123 to FME Flow via a webhook. Follow Parts 1 through 4 (until you finish Part 3 Step 8) of the article Push Data from ArcGIS Survey123 to an Application in Real-time with Webhooks to:
- Create a Webhook Trigger automation in FME Flow
- Register the webhook endpoint in ArcGIS Survey123
- Create the first portion of the workflow to parse the JSON payload
Return to this article once you have completed Part 3. By this point, your Form workspace should look similar to this:
2. Fetch the Image Attached to the Survey123 Submission
To fetch the survey photo that was submitted with the Survey123 report, we’ll add an ImageFetcher to the canvas with the following parameters set:
Select your Esri ArcGIS Online web connection for this transformer to fetch the image.
3. Filter by Image Type
For this workflow, we’ll accept two image formats: PNG and JPEG. Use a TestFilter to sort the following 3 output ports:
4. Extract the Images Into a BLOB
Because the AI service expects raster input rather than a raw attachment, we first extract the image payload into a raster BLOB.
Connect a RasterExtractor to the TestFilter's PNG output port. Select PNG as the Format in the parameters.
Connect a second RasterExtractor to the TestFilter's JPEG output port. Select JPEG as the format.
Connect a Terminator to the “UNSUPPORTED TYPE” output port of the TestFilter. This will stop the translation if an unsupported image type is fed through the workflow.
5. Connect to AI Vision Service
Here, we feed the extracted raster to the AI Vision service. For example, we’ll use Google Gemini through the GoogleGeminiVisionConnector custom transformer available on the FME Hub.
Set the Input Type to Raster Geometry, then select the GoogleAI Parameters:
| GoogleAI API Key | This should be your own API key |
| Model | Choose a model, eg, Gemini 2.0 Flash |
| Prompt | You are an asset inspector. Rate visible condition with rubric: 1 New/no issues, 2 Minor cosmetic wear, 3 Moderate wear, 4 Severe wear, 5 Critical/broken/unsafe. If the ai_rating is 0, 4, or 5 then set ai_flag to "Y", otherwise set ai_flag to "N". If the asset is not visible or photo quality prevents rating, return ai_rating=0. ALSO return confidence (0-100 integer), detected_asset_type (string), and a short reasons string. Use this number for objectid: @Value(objectid). OUTPUT ONLY valid JSON: {"objectid":int,"ai_rating":int,"ai_flag":"string","confidence":int,"detected_asset_type":"string","reasons":"string"} |
Alternatively, you could also toggle on “Use structured outputs?” and then paste the JSON schema there.
6. Parse the AI response
Since the AI returns a single JSON response rather than individual attributes, we need to extract each attribute to write it to the database.
Set the following parameters in a JSONExtractor to extract the target attributes:
JSON Document: _response
| Target Attribute | JSON Query |
| objectid | JSON["objectid"] |
| ai_rating | JSON["ai_rating"] |
| ai_flag | JSON["ai_flag"] |
| confidence | JSON["confidence"] |
| detected_asset_type | JSON["detected_asset_type"] |
| reasons | JSON["reasons"] |
7. Clean Up Attributes before Joining
Add an AttributeManager before the join to trim some attributes and keep the output schema clean.
. We can now remove attributes such as:
- _response, _creation_instance, json_type, json_index, _webhook.feature, _http_headers{}.name, _http_headers{}.value, fme_basename
8. Join the Image with the Survey Point
To link the extracted raster back with our survey point data, we’ll use a FeatureJoiner set up like below:
9. Clean Up Attributes before Writing
Add another AttributeManager to clean up any remaining unnecessary attributes before the records are written to the database:
- _creation_instance, json_type, json_index, _webhook.feature
10. Write to Database and Publish to FME Flow
For this example, a SpatiaLite Writer was used. However, you are free to choose your own writer.
Complete the remaining steps in the article, from Part 4 Step 5 to the end of Part 5:
This part of the workflow is now complete! It should look like this:
And your Flow Automation should look similar to this:
11. Test out the Workflow
To ensure everything has been set up correctly, submit a sample report through ArcGIS Survey123 with a photo.
If successful, the following flow should occur:
- Submit a sample report through Survey123
- FME Flow automation automatically receives the submission
- FME Flow runs the Form workspace we just created
- The SpatiaLite database is updated with the AI-enhanced attributes, survey image, and location of the survey if submitted
Part 2: Scheduled PDF Report
This part adds a scheduled workflow that queries the enriched inspections database, generates a human-readable PDF summary, and emails it to reviewers weekly. The report gives QA reviewers a concise digest of recent inspections, showing flagged assets alongside the inspector’s rating, the AI rating, and the inspection photo.
1. Read the Database
Because this workspace will be automated in FME Flow, we need a user parameter to specify the SpatiaLite database created in Part 1.
Add a Creator transformer, then connect a FeatureReader. Set the following parameters:
- Format: SpatiaLite
- Dataset: User parameter (so the database path can be configured at runtime on FME Flow)
- Output Ports: Single Output Port
The database schema is not expected to change, so we can manually expose the attributes. Add an AttributeExposer transformer. In its parameters, click Import > From Dataset, then:
1. Select SpatiaLite as the format and
2. Browse to your SpatiaLite database file
3. Click Next, and ensure the feature type is selected
1. Click Select all to select all attributes
2. Click Import, then click OK
2. Filter For Flagged Records
We only want AI-flagged records to continue downstream. Filter using a Tester to only keep records where ai_flag = Y:
3. Convert the Database Date Attribute
Survey123 timestamps are stored in epoch milliseconds. We need to convert them to FME datetime format for date range filtering.
Add an AttributeCreator to create a new attribute called _date_seconds with the following value: @div(@Value(_date),1000).
Then connect a DateTimeConverter with the following settings:
Your workflow should look like this. Feel free to group this section in a bookmark:
4. Grab the Report Date Range
Because this workspace runs on a weekly FME Flow schedule, we need to dynamically calculate the start of the previous week at runtime.
Start with a Creator, then connect a DateTimeStamper with the default settings.
After, connect a DateTimeCalculator. Subtract 7 days from the time given by the DateTimeStamper to get the beginning of our 1-week range.
5. Keep Records Within Date Range
Now that we have both the converted submission dates and the 7-day window, we can filter to keep only records that fall within the past week and have a Tester. Connect the output ports of both the DateTimeConverter and the DateTimeCalculator to it.
Within the Tester, set the following test clause:
- Left Value: _date_seconds
- Operator: In Range
- Right Value: [@Evaluate(@Value(_result_datetime)),@Evaluate(@Value(_timestamp))]
After the Tester, use an AttributeManager to remove the following attributes:
- _date, _creation_instance, _timestamp, _result_datetime
Feel free to use bookmarks to group your workspace. Your workflow should look similar:
6. Format PDF Document
For the PDF report, use the DocumentPDFStyler transformer to apply formatting. Refer to the prerequisite article Getting Started with Document PDF Writing for detailed guidance on configuring the DocumentPDFStyler.
The report workspace uses the following sections, each styled with a DocumentPDFStyler:
- Heading: A title block for the report
- Asset Image: Writes each inspection photo to a temporary file using an AttributeFileWriter (via TempPathnameCreator), then feeds it to a DocumentPDFStyler as an image element. Two branches handle PNG and JPEG images separately.
- Asset Info: A text block showing the Asset ID and inspection timestamp
- Human vs AI Table: A table showing the inspector’s rating and evaluation alongside the AI rating and reasoning
You can add attributes directly to an output port of a transformer. Right-click on a transformer’s output port, then select Add Attribute. Use this to determine the order in which the PDF document sections show up in the final output.
For the example workflow, an attribute named content_order was added to each DocumentPDFStyler, numbered in ascending order in the following order from 1 to 6:
- Heading, PNG image, JPEG image, Asset Info, Human vs AI Table, Page Break
Connect all DocumentPDFStylers to a Sorter transformer to order the report records. Also, connect the AttributeManager's output port to the Sorter.
7. Add the Document PDF Writer
Connect the Sorter to a Document PDF Writer. For the writer feature type, set the dataset name to something such as Report. Once the writer feature type is on the canvas, edit the Destination PDF Document file to be a user parameter input:
This section of your workflow should be similar to the following:
8. Set Up the FME Flow Schedule and Email Action
Publish the report workspace to FME Flow. Then create a new automation to run it weekly and email the resulting PDF to reviewers. For guidance on setting up the Email action in FME Flow, please refer to this article.
In FME Flow, navigate to Automations and create a new automation:
- Trigger: FME Flow Schedule set to run weekly, eg, Monday at 8 AM.
- Action: Run Workspace and select the report workspace published above. Ensure the parameters are set to use the resources published onto Flow.
-
Action: Send Email
- Set up your mail service, for example, Gmail.
- Then, configure the subject, format, attachment, and body:
The Flow Automation should look similar to this:
Should you wish, you could also include an error-handling flow in the automation.
8. Verify the Report
Manually trigger the report automation from FME Flow before relying on the schedule. In the Jobs view, confirm the workspace completes without errors and check that:
- The PDF is generated correctly
- The email is delivered to reviewers with the PDF attached
- The report contains the expected flagged assets for the past week
The final report presents each AI-flagged asset on its own page, including the inspection photo, inspector rating, evaluation, AI rating, and reasoning.
Considerations When Using AI
AI vision models can be a powerful addition to a QA workflow, but there are a few considerations to keep in mind:
- Outputs may vary: AI models can produce slightly different ratings or reasoning across runs, even when given the same image. The AI assessments should be used as a signal for human review, not a definitive result.
- Prompt tuning: The prompt provided in this article is a starting point. You may need to adjust the rubric, tone, or output format to suit your specific asset and QA requirements.
- Model selection: Different models vary in accuracy, cost, and speed. Test a few options against your real inspection data before committing to one.
- AI is not a replacement for human review: The goal of this workflow is to surface likely issues efficiently — a human reviewer should always make the final call on flagged assets.
Additional Resources
- Push Data from ArcGIS Survey123 to an Application in Real-time with Webhooks: The prerequisite article for setting up the Survey123 webhook and FME Flow automation used in Part 1.
- Getting Started with Document PDF Writing: Background reading on styling and writing PDF reports using the DocumentPDFStyler transformer and Document PDF writer.
- FME Hub: AI Vision Connectors: Browse available AI vision connector custom transformers, including the GoogleGeminiVisionConnector used in this workflow.
- Getting Started with AI: Explore the use of AI in FME. Contains tutorials for how to successfully connect an FME workspace to an AI provider, as well as many interesting AI use cases.