All posts

How a Local Agent Workflow Can Produce Rule-Guided Blog Content

A practical overview of a local Docker workflow that uses a Telegram bot, an LLM API, and agent orchestration to create rule-guided blog drafts and cover-image output.

Diagram of a local Docker content workflow linking Telegram, an LLM API, agent orchestration, a blog draft, and a cover image.

A practical workflow for agent-assisted blog production

Publishing consistently does not have to mean writing every draft from scratch. A local, agent-driven workflow can turn a content request into a blog draft and cover-image brief while staying within predefined writing and style rules.

The prototype described here runs locally in Docker, receives requests through a Telegram bot, calls an LLM API to interpret them, and produces content according to a specified editorial framework. Agent orchestration can be built with tools such as LangGraph or Mastra.

Start with editorial constraints, not the prompt alone

The key input is more than a topic. The system needs explicit rules that tell it how to write and what it must avoid. Depending on the site, those rules can cover:

  • Voice, tone, and intended audience.
  • Required structure, such as title, introduction, headings, FAQ, and closing section.
  • Terminology to use consistently.
  • Claims that require evidence or should not be made.
  • SEO fields and image requirements.
  • Formatting rules for the final CMS-ready draft.

This shifts the task from “write an article about this” to “produce a draft that follows this publication’s editorial system.”

The local agentic setup

A local Docker deployment provides a contained environment for the workflow. The Telegram bot acts as a simple request channel: a user sends the subject or instruction, and the workflow passes it to the LLM API for interpretation and generation.

The agentic layer is responsible for coordinating the steps rather than treating generation as one oversized prompt. A possible sequence is:

  1. Receive and parse the request from Telegram.
  2. Apply the established style and writing rules.
  3. Plan the article structure.
  4. Generate the blog draft and its supporting metadata.
  5. Create a cover-image prompt or image output, depending on the configured toolchain.
  6. Return the result for review before publication.

LangGraph and Mastra are examples of engines that can be evaluated for this kind of orchestration. The right choice depends on the project’s workflow, integration requirements, and preferred development approach.

Keep a human review step

Automation can accelerate the first draft, but it should not remove editorial responsibility. Before publication, review the output for factual accuracy, tone, completeness, links, brand language, and image suitability.

The workflow is most useful when it creates a consistent starting point that a person can approve or refine. Style rules guide the model; they do not independently verify every claim.

Early cost signal from the prototype

In the test completed so far, the reported cost was approximately USD 0.10 per generated blog post including its image. This is an early prototype result, not a fixed production price. Actual costs can vary with the LLM and image services selected, article length, token use, retries, and the number of generation steps.

A useful next step for interested teams

The prototype has performed very well in the work completed to date. More detail about the tool itself can be explored in future posts. For people interested in applying a similar workflow to their business, the repository may be shared and a free one-to-one implementation session can be offered.

The practical goal is not content at scale for its own sake. It is a repeatable editorial process: send a request, enforce the rules that matter, generate a structured draft, and review it before it reaches the website.

What to define before building

Before connecting a bot, an LLM API, and an orchestration engine, document the following:

  • Who can submit requests and what information each request must include.
  • The style guide and non-negotiable editorial rules.
  • The desired output format and publication destination.
  • Which steps may run automatically and which require approval.
  • How API credentials and Telegram access will be managed.
  • How output quality and per-article costs will be measured over time.

With these decisions in place, agentic tooling becomes a way to operationalize an editorial process rather than a black box that writes unchecked content.

// stuck on something similar?

Let's debug it together

Book a call More posts