← All guides

Piwi field notes · 3 min read

How we automated a brand-copy review

Apply an approved terminology change, count the resulting copy, and flag prohibited phrases before a person signs off.

Run this workflow & inspect the verified result →

The business task

A product rename often means editing the same phrase across campaign drafts. After the substitution, someone still has to check character limits and language the brand has chosen to avoid. Combining the rename and a few deterministic checks makes that preparation repeatable.

We built marketing-copy-review using an authored draft: Acme Lite guarantees results in 24 hours. The request replaces Acme Lite with Piwi, sets a 30-character limit, and lists guarantees as a prohibited phrase. This is a reproducible business demonstration, not a customer claim or an automatically published post.

The tool chain

text.replace performs a case-sensitive literal replacement and returns how many occurrences changed. After that step, text.stats measures the revised text while file.metadata independently fingerprints it. These two steps can run in parallel.

copy.review receives the final text, measured character count, fingerprint, and caller-defined rules. It flags an exceeded character limit and performs case-insensitive literal matching for prohibited phrases. The agent makes one workflow call; Piwi handles the ordering and bindings between the four sandboxed tool calls.

What the actual run returned

The tool chain changed one occurrence and produced: Piwi guarantees results in 24 hours. The resulting text contains 36 Unicode code points, exceeding the requested limit of 30. It also still contains guarantees.

The final review returned character-limit-exceeded and forbidden:guarantees, together with the revised text and its SHA-256 fingerprint. readyForReview was false. That is a useful outcome: the automation made the approved rename and clearly identified what still needs editing.

Run it for your own draft

Call piwi_workflow_marketing_copy_review with text, search, replacement, maxCharacters, and forbiddenPhrases. The workflow page includes the exact tested arguments. Set forbiddenPhrases to an empty list when no phrase rule is needed; do not invent prohibited terms merely to make the check appear thorough.

A passing run is also verified using a shorter draft without the prohibited phrase. The workflow does not schedule, send, or publish the copy. Its report is returned to the agent; save it using your own approved process if you need a durable editorial record.

Keep the editorial decision visible

A literal phrase check cannot decide whether a claim is true, whether a disclaimer is adequate, or whether the tone fits the audience. Character counts use Unicode code points rather than a platform's weighted-length rules, so choose the check only where that counting method fits.

The workflow accepts up to 50000 UTF-16 code units of initial text and up to 20 prohibited phrases. It makes no model-generation or provider API calls. Any agent conversation and local computation still have their own costs. We verified the transformations and flags; an editorial pilot should measure how much review work they actually remove.