A self-publisher was spending days on every low-content book — researching the Amazon shelf, designing pages, laying out the interior, checking it, drawing a cover, writing the listing. We turned the whole routine into one unattended pipeline that takes a list of titles and returns finished files.
The run path of the workflow, node by node — what each one does and why it exists. Seven model calls, two IF gates, one loop; everything else is code.
Kicks off a run. There are no operator forms anywhere after this point — the workflow is designed to be started and left alone.
The list of titles for this run, one per line. Every title becomes its own item and travels the whole pipeline independently.
Single source of settings: API endpoints behind the Kie.ai proxy, which model handles each step (provider_competition, provider_brief, provider_design, provider_fix), time budget per node, output folder on disk.
Normalises the raw list — trims, deduplicates, builds a slug for the output folder — and emits one clean item per title.
Fetches the live Amazon search page for the title through ScraperAPI, so the run sees the same shelf a buyer sees today, not a cached guess.
Extracts every listing from the results HTML: title, ASIN, page count, price, rating, review count. Sixteen cards in a typical run.
Opens the top listings' own pages to read what the search results don't show: the look-inside page structure, the description, the cover.
A model reads the shelf and first drops the off-topic listings — the top for a query often contains books about something else. From the relevant ones it derives medians for page count and the features buyers expect.
Turns the streamed model answer into structured JSON and degrades gracefully if the stream arrived truncated — the run continues with what it has instead of dying.
Writes the plan for this book: who buys it, what the 3–5 best competitors do, and what this one must do better — more useful pages, more of them, the fields readers ask for in reviews.
Validates the brief against a schema: page target, required sections, required fields on the daily page. Missing pieces are filled with defaults, not silently ignored.
Designs the repeating worksheet — every field, its size and order. Split out into its own call so it fits the API gateway's two-minute window.
Checks the page design: a DATE field must exist, no owner or personal-data fields may exist, columns must add up to the page width.
Front matter: title page, copyright page (© and year, never an author), how-to-use page, any reference pages the brief demands.
Schema check for the front matter and the copyright line; rejects placeholder text and empty pages.
Back matter: review pages, summaries, notes — sized to reach the page target without padding the book with duplicates.
Merges the three designs into one BookSpec: the ordered page list with repeat counts, plus the trim size, margins and paper (always white).
The largest node — a JavaScript PDF builder that renders the 6×9" interior with KDP margins. While rendering it runs machine QA: duplicate pages, missing date fields, forbidden owner fields, dead vertical space, column widths, table cell text, copyright presence.
A second model reads the finished book against the brief and lists findings by severity. The machine QA report is passed in so the auditor adds to it instead of repeating it.
Counts what blocks a release: critical and important findings plus the builder's own blockers. This number — not a feeling — decides whether the book may ship.
IF node. Blocking findings and rounds remaining → go fix. Nothing blocking → move on. Out of rounds and still blocking → the book fails with the report attached.
Claude rewrites the BookSpec to resolve every finding — the audit is the diagnosis, this is the treatment. Runs up to three times per book.
Validates the corrected spec and sends it back to Build interior for a full rebuild, so fixes are verified on real pages, not assumed.
IF node. Guarantees the final rebuild is audited before the cover is drawn — a fixed book is never trusted on its word.
Computes the full-wrap cover from the final page count: trim, bleed, spine width, safe zones — exactly as KDP's cover calculator would.
Estimates KDP printing cost from page count and trim, so the listing price on the back cover and in the metadata is realistic.
Sends the cover brief to GPT Image through Kie.ai — create task, poll until ready — and requests three variants that follow the shelf's selling formula: big title with an accent word, subtitle band, icon row, promise on the back.
Measures each variant: text inside the safe margins, nothing on the spine fold, no reserved barcode box. Saves the three covers as PNG.
Writes the interior PDF and the run's metadata into the title's folder on the server's disk.
Writes the SEO title — search phrase first, keyword subtitle after — and a selling description with keyword variants, plus the right disclaimer (medical for health topics, general otherwise).
Collects every step's result — timings, counts, findings, files — into one text report saved next to the book.
Loop node. Returns to the next title in the list until the run is exhausted; each title gets a fresh budget of time and fix rounds.
Summary for the whole run: which books shipped, which failed the gate and why.
Research, design, layout, audit, cover and listing — the whole production line runs unattended, and quality is enforced by a gate, not by a checklist someone has to remember.
Describe it in two sentences — we reply within a day with a pipeline sketch.
hello@wireclad.com →