Back to buildsBUILD RECORD

Metaphor in Matter / Creative automation / 2026

Reviewing generated images before caption work begins.

An n8n pipeline turns model reviews into explicit acceptance decisions, then gives a failed caption one repair attempt before saving a draft or a stage-specific rejection.

THE WORK

The project.

Metaphor in Matter separates making an image from deciding whether to develop it into a social draft. The exported n8n pipeline parses an image review, checks positive and risk scores, and requires an explicit publishable flag before caption generation begins. A malformed response or a rejection reason stops that path, so missing review data doesn't look like a pass.

Caption review adds its own scores and flags, plus a narrow check for overlap with visible-fact terms. A failed caption can be repaired once and checked again; the result becomes a draft or a recorded social rejection. Image rejection remains a separate outcome. These are implemented editorial rules, not calibrated measurements of quality, and accepted drafts aren't publication results.

IMPLEMENTATION

Design choices.

  1. Generation is tied to one owned pool candidate. Claim verification and the single-item assertion keep the provider path from accidentally receiving an ambiguous batch of candidates.
  2. Unusable review output is rejected. When JSON parsing fails, the workflow supplies zero positive scores, maximum risk scores and publishable=false. An empty assessment therefore can't carry the image into caption generation.
  3. The scoring rules are explicit. Each of four positive dimensions needs at least 8/10; ordinary-image risk must be at most 2.5 and caption dependency at most 3. These thresholds make a decision repeatable from the supplied scores, not an objective measure of the image.
  4. Caption QA includes a narrow text check. When visible-fact terms exist, the caption needs at least two overlaps as well as its model checks. Generic words can still overlap, so this constraint doesn't establish that the description is correct.
  5. Caption correction stops after one repair. A second failed review becomes social-rejected instead of triggering another automatic attempt. That keeps persistent caption failure distinct from an earlier image rejection or a provider transport failure.

HOW IT FITS TOGETHER

Architecture.

  • Telegram routing separates library and source work from image generation. Briefs enter a shared Data Table pool; the generation workflow conditionally claims a ready candidate, verifies the run owner and asserts that exactly one input item reaches the provider path.
  • The returned image goes through model review and a parser for known response wrappers. The parser reads JSON, bounds scores and requires publishable to be literally true. Thresholds and explicit failure reasons determine whether caption work may start.
  • Caption QA combines model scores and flags with a visible-fact term-overlap check. The first failed caption can go to a repair writer, then one further QA pass decides whether it becomes a draft or social-rejected output.
  • Image rejection, caption rejection and draft output have distinct paths, preserving the stage that made the decision. Separate stale-lock maintenance handles abandoned work, but its update currently matches locked status without the candidate key or owner and needs tighter scope.
Explore the architecture map9 components · 13 connections

Shared brief pool and image-to-caption quality gates

The generation path owns one pool candidate, then records either a rejection state or a draft social result.

Direct callAsync taskBlocked / denied
Routing and library
Owned image generation
Editorial outcomes

Scroll or drag the background to move. Use the zoom buttons to resize.Arrow keys move between components. Enter selects.

Choose a component to explore

Select a numbered component on the map or use the component menu. Its details and connections will appear here.

No component selected.

All connections (13)
  1. 01 · Telegram router02 · Brief library pipelineSource / replay input · Direct call
  2. 02 · Brief library pipeline03 · Candidate poolValidated ready brief · Direct call
  3. 01 · Telegram router04 · Conditional claim and owner checkImage command · Direct call
  4. 03 · Candidate pool04 · Conditional claim and owner checkReady candidate · Direct call
  5. 04 · Conditional claim and owner check03 · Candidate poolOwned lock · Direct call
  6. 04 · Conditional claim and owner check05 · Image providerOwned render payload · Async task
  7. 05 · Image provider06 · Image-depth validationRendered output · Direct call
  8. 06 · Image-depth validation07 · Caption QA and one repairAccepted image + visible facts · Direct call
  9. 06 · Image-depth validation08 · Rejected pool statesImage rejected · Blocked / denied
  10. 07 · Caption QA and one repair08 · Rejected pool statesCaption rejected · Blocked / denied
  11. 07 · Caption QA and one repair09 · Draft social recordsAccepted draft · Direct call
  12. 08 · Rejected pool states03 · Candidate poolRejection status · Direct call
  13. 09 · Draft social records03 · Candidate poolCompletion status · Direct call

MADE WITH

n8n · JavaScript · Data Tables · Telegram · OpenAI · xAI · Apify · fal · Google Drive · Notion

CHECKS & RESULTS

What was checked.

A source review shows what the code does. It is not a fresh test of the running app.

  1. Code and development records reviewedReviewed

    The code, tests and available development records were checked. Reported test results keep their original scope. No fresh app or live deployment check was run for this write-up.

    Scope of this check
    Code review, not a fresh run of the app

NEXT

Still to work through.

The pipeline makes acceptance and repair decisions explicit enough to inspect, but those decisions must still apply to the right candidate. Stale-lock maintenance needs the candidate key and owner in its update, and later pool writes need consistent ownership checks. No provider generation, quality calibration or concurrency test was performed for this review.