Step 2: Workflow

This chapter defines how the automation executes in production, from set validation to review and publish. Step 1 defined why and boundaries; Step 2 defines runtime behavior.

2.1 End-to-end execution model

The workflow is a staged desktop pipeline orchestrated in main_set.py. It is designed so the operator can process high-volume sets while keeping strict publish control through a mandatory review gate.

Amir2000 Image Automation workflow chart

Workflow figure: high-level stage flow from import through publish.

2.2 Stage sequence in main_set.py

  1. Validate sets - checks selected set inputs before any write operations.
  2. Prepare DB and copy to incoming - establishes working context and staged local inputs.
  3. Extract EXIF and initial metadata - seeds technical metadata used downstream.
  4. Insert or refresh review rows - creates or updates queue rows in review_queue.
  5. AI quality scoring - computes quality signals for later review decisions.
  6. Resize images for Ollama - writes temporary model-ready files and tracks ollama_path.
  7. Caption and keywords prefill - generates assistive metadata suggestions locally with evidence-first keyword guardrails, plus filename/time-of-day consistency checks and NL lowland anti-mountain filtering.
  8. Open review editor - transitions into manual review and approval workflow.

2.3 Runtime data flow

2.4 Review and publish path after stage 8

  1. Operator validates and edits caption, alt text, keywords, and filename fields.
  2. Each row receives a decision status (approved or rejected).
  3. Publish action targets approved rows only.
  4. Uploader sends full image and thumbnail outputs to configured FTP destinations.
  5. MySQL upsert is applied using File_Name as stable key.
  6. Local mirror IDs and publish state are synchronized after remote write success.
  7. Temporary model artifacts are cleaned when publish completes without blocking errors.

2.5 Queue statuses and transition intent

Primary fields:

Transition rule: no row enters publish state without explicit review approval.

2.6 Failure handling and rollback behavior

Failures are handled as session events, not isolated row edits. If a blocking error occurs during the pipeline, rollback logic restores operational consistency so a clean rerun is possible.

Rollback event example in Amir2000 Image Automation

Rollback figure: blocking caption-model error followed by automated session cleanup.

2.7 Run artifacts and logs

2.8 Continuation path

Step 2 describes execution behavior. Step 3 defines daily operation, checklists, and recovery procedure for production use.

© 2026 Amir Darzi
Privacy Policy  |  Photography site | W3C-Valid  |  Cookie settings