get_field_map_status Database
Poll the pipeline-run state of the background database field mapping step
Overview
Inspects the underlying pipeline-run state of the background `database_field_map_async` step that backs `map_source_database_to_target`. Returns the run status (queued | running | completed | error | interrupted) along with timing information. When status is 'completed', also returns the resulting field_map_id and its current draft/confirmed status so you can proceed to confirm_field_map or generate_database_seed_script. For most callers, get_field_map is the simpler poll endpoint; use this tool when you want to inspect the pipeline run itself — timing, error category, run number.
How It Works
- Validates that the clone job belongs to the authenticated user.
- Looks up the pipeline step run for `database_field_map_async` on this job — either the most recent run or a specific run_number if provided.
- Maps the raw DB row into a human-readable status: queued (not yet started), running (in progress), completed (finished without error), error (failed), or interrupted (stuck/crashed).
- process_restart rows (redeploy/SIGTERM) are surfaced as 'queued' so polling clients don't see a spurious error after a routine restart.
- When status is 'completed', queries database_mapping_field_map for the resulting field_map_id and its current status (draft/confirmed).
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
job_id |
string |
required | Clone job ID passed to map_source_database_to_target |
source_file_id |
string |
required | Same source_file_id that was passed to map_source_database_to_target |
target |
string |
required | Same target platform ID that was passed to map_source_database_to_target |
run_number |
number |
optional | Optional pipeline run_number. If omitted, the most recent run of database_field_map_async for this job is checked. |
What You Get Back
- status — queued | running | completed | error | interrupted
- job_id, step_key, run_number, source_file_id, target
- started_at and completed_at timestamps
- error_category and error_message when status is error or interrupted
- field_map_id and field_map_status when status is completed
- model_used — the LLM model that produced the mapping
- next_steps — guidance string when completed (e.g. use get_field_map to review, then confirm_field_map)
- message — explanation when status is never_run or field_map row is missing
Example Use Case
After calling map_source_database_to_target, an agent polls get_field_map_status every 10 seconds. The first two polls return status='running'. The third returns status='completed' with field_map_id and field_map_status='draft', so the agent switches to get_field_map to review the mapping entries.
