Match images to products by filename
In a nutshell
This job reads the items you selected in the grid and the ZIP of images you upload. For each item, it keeps the images whose file name contains one of the item's identifiers, asks a language model to match these file names to the IMAGE fields you flag, and creates one suggestion per item holding the matched images.
The model reads the file names only, never the pictures. Only IMAGE fields marked with a metadata key (default: ai-image-matching set to true) receive images, and items with no image of their own in the archive cost no AI call.
📥 Download the latest version of this job.
⌛ Time to setup: 10 minutes.
📋 Prerequisites: A Product-Live account with Data Factory access, an API key for your language model provider (the packaged job is configured for Mistral), images named after an identifier of their item, and a launch from the table and the screen holding the items you selected in the grid.
The current version is (last updated on 2026-11-13).
Generic job reference: .
Name of the job once imported: AI Image Matching.
Result
Once set up, the job is available in the Data Factory jobs list.
Launch the job from the table and the screen holding the items you want to illustrate, with those items selected in the grid, and upload a ZIP of images when the job asks for it. The selection is what the job reads: with no item selected, the run stops before any request and asks for a selection.
When executing the job on a selection of items:
- The ZIP is extracted and its images are listed (jpg, jpeg, png, webp and gif files)
- Each selected item keeps the images whose file name contains one of its identifiers, up to 100 items per run (the
maxItemssetting); see File naming rule - For each item with at least one image of its own, the file names are sent to the language model, which reads the view written in each name (for example
main-vieworfront) and picks the flagged IMAGE field that expects it - One suggestion is created on the item, holding one image per matched field. The suggestions appear in the standard Product-Live suggestions panel with a configurable emitter name (default: AI - Image matching), where you can review and accept or reject them.
- At the end of the run, a short report in the execution's Actions panel gives the number of items read, of images in the archive and of suggestions created, and the estimated cost of the AI requests

What you keep control of
- Which items are read: only the items selected in the grid when you launch the job are read, up to
maxItems; see Result. - Which images belong to which item: the identifier written in each file name decides it, before any AI call; see File naming rule.
- Which fields receive images: only IMAGE fields you flag with the metadata key are targets; see Field metadata configuration.
- What the model is asked: the prompt is a text file in the job assets, edited without code; see Prompt template.
- The name shown to your users: the emitter name displayed on each suggestion is a setting of the job; see Configuration (config).
- The provider and the model: both are settings of the job, and the API key is a variable in your account; see Switching provider.
- The last word: the job writes suggestions, never product values; a person accepts or rejects them; see Suggestions created by AI jobs.
Requirement
To deploy this job, you'll need:
- A valid Product-Live account with Data Factory access
- An API key for your language model provider. The packaged job is configured for Mistral (get a key at console.mistral.ai); see Switching provider for OpenAI or Anthropic.
- At least one IMAGE field with the metadata
ai-image-matchingset totrue, on the level of the screen you launch the job from - At least one field of type IDENTIFIER on that level (for example an EAN), whose values appear in the image file names; see File naming rule
- A launch from a table and a screen, with the items to illustrate selected in the grid: the job takes its table, its screen and its items from there
If you don't have access to the Data Factory module, please contact our support team.
Setup
- Download the last version of this job, available here.
- Import the downloaded Data Factory job in your account
- Create a Data Factory variable named
mistral_api_keywith your Mistral API key as the value - Set the metadata
ai-image-matchingtotrueon the IMAGE fields you want to fill - Name each image after an identifier of its item and the view it shows (for example
4002516215981-main-view.jpg), then zip the images
Then open the table and the screen you want to work on, select the items in the grid, launch the job from there and upload the ZIP. Run it on a handful of items and review the suggestions before widening the selection.
File naming rule
The job decides which images belong to which item before calling the model, from the file names alone:
- The identifiers of an item are the values of its fields of type IDENTIFIER, on the level of the launch screen. They need no metadata.
- An image belongs to an item when its file name contains one of these values as a whole token: the value is at the start or the end of the name, or surrounded by characters other than the letters a to z and the digits (for example
-,_,.or a space). The comparison ignores case. - The rest of the name should say which view the image shows (for example
main-view,front,back), close to the key, the title or the description of the IMAGE field that expects it: this is what the model reads.
| File name | Item 123 | Item 123-4 |
|---|---|---|
123-front.jpg | Belongs | No |
41234-front.jpg | No | No |
123-4-front.jpg | Belongs | Belongs |
A file name that holds no identifier of the selected items is ignored, as are files that are not images. The folders of the ZIP are not taken into account: only the file name counts.
Further information
How it works
The job takes its table and its screen from the launch context, and its items from your grid selection. It reads the level of the launch screen, then asks the API, in one request, for the IDENTIFIER fields of that level and for its fields flagged with the metadata. It extracts the uploaded ZIP and reads the selected items.
For each item, the job keeps the images of the archive whose file name contains one of the item's identifiers (see File naming rule). Items without such an image are skipped and cost no AI call. For the others, it inserts into the prompt stored in assets/prompt-template.md the item's identifiers, the flagged IMAGE fields (key, title and description) and the names of its candidate files: no picture, no URL and no other product value is sent. The prompt asks the model to:
- read, for each file, the view written in its file name;
- pick the target IMAGE field that expects this view, using the key, title and description of each field, or no field when none expects it;
- give each field at most one file;
- answer with a JSON object holding one entry per file, with its name, its view and the chosen field key (or
null).
The job then turns each answer that matches at least one file into one suggestion on the item. It keeps only the file names that were sent for that item and the flagged IMAGE fields, and the first file given for a field: a file of another item, an unknown name or another field is ignored.
Switching provider
The job is packaged for Mistral: the provider and model settings of the config task select the provider and the model, and the key is read from the Data Factory variable mistral_api_key, referenced in job.json as the apiKey input of the build_prompts task. To use OpenAI or Anthropic:
- In
config, setprovidertoopenaioranthropic. - In
config, setmodelto a model of that provider, see Available models. - Store that provider's key in the
mistral_api_keyvariable, or create a new variable and change the${workflow.globalVariables.mistral_api_key}reference injob.json. - Optionally change
suggestionNameso reviewers see the right source.
This job requests responseFormat: json_object, which Anthropic ignores; the prompt template already asks for JSON, so check that the answer parses on a test run. Re-import the job and run it on a small selection first.
Field metadata configuration
To mark an IMAGE field as a target for image matching, add the following metadata to the field definition:
json
{
"ai-image-matching": "true"
}1
2
3
2
3
Only IMAGE fields with this metadata set to true receive images. The job filters the fields through the API, so a field flagged with another value, or on another level than the launch screen, is never read.
The identifier fields need no metadata: every field of type IDENTIFIER on the level of the launch screen is read.
The metadata key is written in the criteria of the find_fields task, and in the message of the check_fields task shown when no field is flagged: change it in both places to use another key.
Prompt template
The prompt sent to the language model is stored in assets/prompt-template.md. It uses three placeholders, each replaced at runtime with a JSON value for one item:
| Placeholder | Content |
|---|---|
{{IDENTIFIERS}} | The values of the item's identifier fields |
{{FIELDS}} | The flagged IMAGE fields, each with its key, title and description |
{{FILES}} | The names of the item's candidate files |
You can edit this file to customize the instructions given to the model without modifying any JavaScript code. Keep the answer format: the job reads files, filename and fieldKey, for example {"files": [{"filename": "4002516215981-back-view.jpg", "view": "back-view", "fieldKey": null}]}.
The prompt gives examples that map main-view, front and back to MAIN_VIEW, FRONT_VIEW and BACK_VIEW. The model needs such examples to match reliably: adapt them to your field keys and to the views written in your file names.
Configuration (config)
All configurable values are grouped in the first task config of job.json. Edit its inputParameters to customize this job:
| Setting | Key | Default | Description |
|---|---|---|---|
| Provider | provider | mistral | The language model provider, see Switching provider |
| Model | model | mistral-small-latest | The AI model used for the API call |
| Maximum items | maxItems | 100 | The number of selected items read in one run; the rest of the selection is not processed |
| Suggestion name | suggestionName | AI - Image matching | The emitter name shown on created suggestions |
| Pricing | pricing | {"currency": "USD", "inputPerMillionTokens": 0.15, "outputPerMillionTokens": 0.6} | The prices behind the estimated cost of the report: the price per million input tokens and per million output tokens of model, in currency. The defaults follow Mistral's public prices for mistral-small-latest in November 2026: update them when you change provider or model, see Cost and limits |
There are no table or screen settings: the job reads context.view.table, context.view.partition and context.view.screen from where it is launched, and the items from the grid selection.
Variables
| Variable | Description |
|---|---|
mistral_api_key | Your API key for the language model provider (passed to the provider by the AI / Call a model task) |
User input
| Parameter | Type | Description |
|---|---|---|
| A ZIP file containing the images to match (required) |
Outputs
| Output | Description |
|---|---|
itemsRead | Selected items read, at most maxItems |
itemsMatched | Items with at least one image of their own in the archive, sent to the model |
maxItemsReached | true when maxItems items were read: the selection may hold more, so select fewer items or raise the setting |
imagesInArchive | Images found in the archive |
suggestionsCreated | Suggestions created, one per item with at least one matched image |
imagesSuggested | Images suggested, summed over the items |
aiErrors | Answers that failed or could not be read; the other items are unaffected |
message | The report shown in the Actions panel |
Cost and limits
- One request is sent per selected item that has at least one image of its own in the archive, at most
maxItemsper run. Each request carries the item's identifiers, the flagged IMAGE fields and the names of its candidate files. - The cost shown in the report is an estimate: the tokens the provider reported, priced with the
pricingsetting.
Job design
The job is composed of 14 tasks. The identifier and flagged fields are found through the API in one request, the items are read with these fields only, the images are matched to the items by file name before any AI call, and all AI prompts run in parallel through task-batch-execute, organized as presented in the following diagram:
mermaid
flowchart TD
_start(("Start"))
_end(("End"))
config["<b><a href='/data-factory/references/tasks/set-variable/'>set-variable</a></b><br />Job settings - edit the values below"]
check_selection{{"<b><a href='/data-factory/references/tasks/switch/'>switch</a></b><br />Stop when no item is selected in the grid"}}
terminate_no_selection(["<b><a href='/data-factory/references/tasks/terminate/'>terminate</a></b> (COMPLETED)<br />No item is selected"])
find_screen["<b><a href='/data-factory/references/tasks/data-screen-find/'>data-screen-find</a></b><br />Read the launch screen to get the level of the selected items"]
find_fields["<b><a href='/data-factory/references/tasks/data-field-find/'>data-field-find</a></b><br />Find the identifier fields of that level and its fields flagged with the metadata ai-image-matching"]
check_fields{{"<b><a href='/data-factory/references/tasks/switch/'>switch</a></b><br />Stop when no IMAGE field is flagged"}}
terminate_no_fields(["<b><a href='/data-factory/references/tasks/terminate/'>terminate</a></b> (COMPLETED)<br />No IMAGE field is flagged"])
unarchive_images["<b><a href='/data-factory/references/tasks/file-conversion-unarchive/'>file-conversion-unarchive</a></b><br />Extract the files of the uploaded ZIP archive"]
find_items["<b><a href='/data-factory/references/tasks/data-item-find/'>data-item-find</a></b><br />Read the selected items, with the identifier and flagged fields only"]
build_prompts["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Keep the images whose file name contains an item identifier and build one prompt per item that has some"]
check_prompts{{"<b><a href='/data-factory/references/tasks/switch/'>switch</a></b><br />Stop when no image of the archive belongs to a selected item"}}
terminate_nothing_to_match(["<b><a href='/data-factory/references/tasks/terminate/'>terminate</a></b> (COMPLETED)<br />No image of the archive belongs to a selected item"])
run_prompts["<b><a href='/data-factory/references/tasks/task-batch-execute/'>task-batch-execute</a></b><br />Send the prompts to the AI provider, five at a time"]
build_suggestions["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Turn the matches into one suggestion per item"]
check_suggestions{{"<b><a href='/data-factory/references/tasks/switch/'>switch</a></b><br />Create the suggestions when the AI matched images"}}
create_suggestions["<b><a href='/data-factory/references/tasks/data-suggestion-create/'>data-suggestion-create</a></b><br />Create the suggestions, failing if one is refused"]
build_report["<b><a href='/data-factory/references/tasks/code-execute-javascript/'>code-execute-javascript</a></b><br />Write the short report shown at the end of the run"]
display_report["<b><a href='/data-factory/references/tasks/notification-display-message/'>notification-display-message</a></b><br />Show the report in the Actions panel"]
_start --> config
config --> check_selection
check_selection -->|"NO_SELECTION"| terminate_no_selection
check_selection -->|"default"| find_screen
find_screen --> find_fields
find_fields --> check_fields
check_fields -->|"NO_FIELDS"| terminate_no_fields
check_fields -->|"default"| unarchive_images
unarchive_images --> find_items
find_items --> build_prompts
build_prompts --> check_prompts
check_prompts -->|"NOTHING_TO_MATCH"| terminate_nothing_to_match
check_prompts -->|"default"| run_prompts
run_prompts --> build_suggestions
build_suggestions --> check_suggestions
check_suggestions -->|"CREATE"| create_suggestions
create_suggestions --> build_report
check_suggestions -->|"default"| build_report
build_report --> display_report
display_report --> _endTasks
| # | Task | Reference | Description |
|---|---|---|---|
| 1 | set-variable | config | Hold the job settings |
| 2 | switch + terminate | check_selection | Terminate in success if no item is selected in the grid |
| 3 | data-screen-find | find_screen | Read the launch screen to get the level of the selected items |
| 4 | data-field-find | find_fields | Find the IDENTIFIER fields of that level and its fields whose metadata ai-image-matching is true |
| 5 | switch + terminate | check_fields | Terminate in success if no IMAGE field is flagged |
| 6 | file-conversion-unarchive | unarchive_images | Extract the files of the uploaded ZIP archive |
| 7 | data-item-find | find_items | Read the selected items with the identifier and flagged fields only (includedFieldKeys), at most maxItems |
| 8 | code-execute-javascript | build_prompts | Keep, for each item, the images whose file name contains one of its identifiers, and build one ai-prompt-execute entry per item that has some, from assets/prompt-template.md |
| 9 | switch + terminate | check_prompts | Terminate in success if no image of the archive belongs to a selected item |
| 10 | task-batch-execute | run_prompts | Run one prompt per item in parallel via ai-prompt-execute (concurrency: 5) |
| 11 | code-execute-javascript | build_suggestions | Parse the answers, build one suggestion per item and add up the tokens used |
| 12 | switch + data-suggestion-create | check_suggestions / create_suggestions | Create the suggestions, one per item, only if the model matched images |
| 13 | code-execute-javascript | build_report | Write the short report, with the estimated cost of the AI requests |
| 14 | notification-display-message | display_report | Show the report in the Actions panel |
Assets
| File | Description |
|---|---|
build-prompts.js | Lists the images of the archive, keeps for each selected item the images whose file name contains one of its identifiers, builds one ai-prompt-execute entry per item that has some, and keeps what was sent to check the answers |
prompt-template.md | The prompt template sent to the language model, with {{IDENTIFIERS}}, {{FIELDS}} and {{FILES}} placeholders |
build-suggestions.js | Parses the answers and builds one suggestion per item, keeping only the item's own files, the flagged IMAGE fields and one file per field, and adds up the tokens the provider reported |
build-report.js | Writes the short report shown in the Actions panel, with the estimated cost of the AI requests |