This project is not covered by Drupal’s security advisory policy.

AI Content Factory automates content generation using AI providers.
It introduces generation profiles that define what content to create and how, and a managed queue that tracks each item through its lifecycle from draft to completion.

Features

Generation profiles

Config entities that encapsulate every parameter needed to generate a content item: target bundle, AI provider and model, system and user prompts for titles and body content, field mappings, word count target, execution mode, publication mode, and optional paragraph field targeting.

Content queue

A managed queue content entities. Each item moves through the following statuses:
draft → queued → processing → completed / failed.
Items can be created manually, or in bulk via the "Generate Titles" form. The queue list supports filtering and bulk batch operations.

Title generation

The Generate Titles form accepts either a free-form list of titles or a prompt that asks the AI to suggest titles. Each accepted title becomes a queue item ready for full content generation.

Execution modes

  • Supervised - items are saved as drafts and only queued when an editor explicitly promotes them. Suitable for reviewing titles before committing to a full generation run.
  • Automatic - items are queued immediately on creation for unattended background processing via cron.

Background processing

Cron processes queued items up to the configured worker item limit. A manual
batch run can also be started from the queue admin page without waiting for
cron. A configurable lock scope prevents concurrent background workers from
colliding on the same items.

Provider execution guardrails

  • Configurable transient retry count and exponential backoff for rate-limit and timeout errors.
  • Shared per-provider/model cooldown stored in expirable key-value storage so both cron and manual runs respect the same throttle window.
  • A separate browser request timeout cap keeps manual browser-driven runs within web-tier limits.

Paragraph field support

When paragraph targeting is enabled in settings, profiles can map generated
content directly into paragraph fields on the target entity.

Diagnostics and debug mode

An optional debug mode retains raw prompt snapshots, generated payloads, and run logs on queue items. Retention is configurable (failed items only, all
items, or none) and expires after a configurable number of days. Raw
diagnostics are gated behind a dedicated `view ai content factory diagnostics`
permission.

Installation

Install as you would normally install a contributed Drupal module.
For further information, see Installing Drupal Modules.

Configuration

  1. Enable the module.
  2. Configure at least one AI provider and set a site default provider.
  3. Configure AI Content Factory global defaults (execution mode, queue limits, provider guardrails, debug retention).
  4. Create one or more generation profiles. Each profile defines:
    • Target entity type and bundle (e.g. node/article).
    • AI provider and model (or use the site default).
    • System and user prompts for title and content generation.
    • Field mappings that tell the AI which fields to populate and how.
    • Execution mode: Supervised (items start as draft, require manual queueing) or Automatic (items are queued immediately).
    • Publication mode: Draft or Auto-publish.
  5. Assign permissions to the appropriate roles:
    • Administer AI Content Factory: Global settings and administration
    • Manage AI Content Factory profiles: Create, edit, and delete profiles
    • Manage AI Content Factory queue: Create and manage queue items
    • Run AI Content Factory batches: Trigger manual or automated runs
    • View AI Content Factory diagnostics: Access prompt/payload diagnostics

Tested models

The following OpenRouter models have been tested with this module. Use the OpenRouter provider from the AI module and enter the model identifier exactly as shown.

  • google/gemini-3.1-flash-lite-preview: Fastest response times; very low cost; good for high-volume queue runs. Lower output quality; less reliable on complex field mappings.
  • perplexity/sonar: Strong factual accuracy due to search grounding; good for knowledge-heavy content. Slower than flash models; higher cost; not ideal for purely creative content.
  • x-ai/grok-4.3: High quality output; strong instruction following; good for complex prompts. Higher cost; slower than fast variants.
  • x-ai/grok-4.1-fast: Good balance of speed and quality; suitable for supervised batch runs. Slightly lower quality than grok-4.3 on nuanced content.
  • google/gemini-3.5-flash: Well-rounded quality and speed; reliable field mapping compliance. Mid-range cost; occasionally verbose on short-form fields.
  • google/gemini-2.5-flash-lite: Fast and cheap; good for title generation and lightweight content. Weaker on long-form structured content.
  • deepseek/deepseek-v4-flash: Very cost-effective; fast; good multilingual support. May require more explicit prompt instructions for structured output.
  • deepseek/deepseek-v3.2: Strong reasoning and long-form quality; good for detailed content profiles. Higher latency; best suited for cron-based background runs.

Troubleshooting

  • Queue items stay in "processing" status after a failure:
    A crashed worker may leave items locked. Check the Drupal watchdog log for the failure reason. Items can be reset to "queued" from the queue admin edit form.
  • Generation times out in the browser:
    Browser-driven runs (manual batch, title generation) are subject to the "Browser request timeout cap" in settings and the web server's own timeout. Increase the cap, or run generation through cron which is not subject to web-tier timeouts. Ensure the Drupal AI module's global request timeout is also set high enough for your provider and model.
  • Provider returns rate-limit errors:
    Increase "Maximum shared cooldown wait" and "Transient retry attempts". Background workers automatically requeue rate-limited items; browser runs will surface a retry-later message.
  • Generated content is not published:
    Check the profile's "Publication mode". The default is "Draft". Switch to "Auto-publish" only if the target bundle has no content moderation workflow, or if a published moderation transition is available to the generation process.

FAQ

Q: Can I use different AI providers for different content types?
A: Yes. Each profile has its own provider and model configuration. On a profile select the provider and model you want for that content type.

Q: Can I generate content in multiple languages?
A: Queue items carry a language code. Create separate queue items (or bulk title submissions) for each target language. The generated entity is saved in the language specified on the item.

Project information

Releases