Skip to content

AI Agent Audit Articles - Automated Publishing Workflow

2026 Verification Notes

This document describes a powerful, pre-built workflow template. A system-wide scan confirms that the concepts, Artisan commands, and architectural patterns described herein are consistent with the current state of the application.

  • Workflow Models: The WorkflowTemplate, WorkflowTask, and related models exist in app/Models.
  • Artisan Commands: The commands mentioned (e.g., workflows:list-templates) are consistent with the commands found in app/Console/Commands.
  • File Paths: Please note that file paths like /var/www/admin.ohm.events/... are specific to a production environment. For local development, source markdown files should be referenced from within the project's root directory (e.g., docs/my-articles/).

Comprehensive workflow template for automatically publishing AI agent audit documentation as optimized WordPress articles with social media distribution.


📋 Overview

This workflow automates the entire process of converting AI agent audit markdown files into high-quality WordPress articles with maximum SEO optimization and social media distribution via Postiz.

Key Features

  • ⏰ Scheduled Execution: Runs daily at 7 AM GMT+7
  • 📁 Automated File Selection: Intelligently selects next MD file to publish
  • 📝 MD to WordPress Conversion: Transforms documentation into engaging articles
  • 🎨 AI-Generated Images: Creates featured images using Image Studio
  • 🔍 SEO Optimization: Achieves 90+ Rank Math SEO score
  • 📱 Social Media Distribution: Posts to all connected platforms via Postiz
  • ⚙️ Fully Customizable: Every node has detailed configuration options

Workflow Duration

  • Total Duration: 11 days (one article per day)
  • Articles: 10 AI agent audit MD files
  • Execution Time: 5-8 minutes per article
  • Schedule: Every day at 7:00 AM Bangkok time (GMT+7)

🚀 Quick Start

1. Install the Workflow Template

bash
php artisan db:seed --class=AiAgentAuditWorkflowSeeder

2. Verify Template Installation

bash
php artisan workflows:list-templates
# Should show: "AI Agent Audit Articles - Daily Publishing"

3. Create Workflow from Template

Via UI:

  1. Navigate to Workflows → Templates
  2. Find "AI Agent Audit Articles - Daily Publishing"
  3. Click "Create Workflow"
  4. Customize settings (or use defaults)
  5. Save and activate

Via Artisan Command:

bash
php artisan workflows:create-from-template \
    --template="AI Agent Audit Articles - Daily Publishing" \
    --name="My AI Agent Blog Series" \
    --activate

4. Verify Required MCP Servers

bash
php artisan test:mcp-servers

Required MCP Servers:

  • ✅ WordPress MCP
  • ✅ SEO MCP (Rank Math)
  • ✅ Postiz MCP
  • ✅ Image Studio

📊 Workflow Architecture

Node Overview

mermaid
graph LR
    A[⏰ Daily Trigger] --> B[📁 Select MD File]
    B --> C[📝 Convert to Article]
    C --> D[🎨 Generate Image]
    D --> E[📰 Publish to WordPress]
    E --> F[🔍 Check SEO Score]
    F --> G{Score >= 90?}
    G -->|No| H[⚡ Optimize SEO]
    G -->|Yes| I[📱 Publish to Social]
    H --> I
    I --> J[✅ Complete]

Detailed Node Breakdown

NodeAgentProviderPurposeCustomizable
Daily TriggerSystem-Schedule execution at 7 AM GMT+7Time, timezone
Select MD FileMuse ModeShareAIChoose next agent file to publishFolder, pattern, strategy
Convert to ArticleMarketingShareAITransform MD to engaging WordPress contentTone, length, style
Generate ImageMarketingShareAICreate featured image with Image StudioProfile, format, dimensions
Publish to WordPressWordPressShareAIPublish article with categories and tagsStatus, categories, author
Check SEO ScoreSEOShareAIAnalyze Rank Math SEO scoreTarget score, factors
Optimize SEOSEOShareAIImprove SEO to 90+ scoreMax attempts, priorities
Publish to SocialMarketingShareAIDistribute to all social platformsPlatforms, timing, copy
CompleteSystem-Log results and send notificationsNotification channels

⚙️ Configuration Guide

Global Settings

Schedule Configuration:

php
'config' => [
    'schedule' => '0 7 * * *', // Daily at 7 AM
    'timezone' => 'Asia/Bangkok', // GMT+7
    'enabled' => true,
]

Common Schedule Examples:

  • 0 6 * * * - 6 AM daily
  • 0 9 * * * - 9 AM daily
  • 0 */6 * * * - Every 6 hours
  • 0 9 * * 1-5 - 9 AM on weekdays only
  • 0 10 * * 0 - 10 AM on Sundays only

Timezone Options:

  • America/New_York - EST/EDT
  • Europe/London - GMT/BST
  • Asia/Tokyo - JST
  • Australia/Sydney - AEST/AEDT

Node-Specific Configurations

📁 File Selection Node

Default Settings:

php
'config' => [
    'ai_provider' => 'shareai',
    'source_folder' => '/var/www/admin.ohm.events/docs/agents/audit/agents/',
    'file_pattern' => '*_AGENT.md',
    'selection_strategy' => 'sequential',
]

Customization Options:

  1. Change Source Folder:
php
'source_folder' => '/path/to/your/markdown/files/',
  1. Custom File Pattern:
php
'file_pattern' => 'ARTICLE_*.md', // Different naming
  1. Selection Strategies:
php
'selection_strategy' => 'random', // Random order
'selection_strategy' => 'priority', // Use priority array
'selection_strategy' => 'date_based', // Newest first
  1. Priority-Based Selection:
php
'file_priority' => [
    'MARKETING_AGENT.md',
    'SEO_AGENT.md',
    'WORDPRESS_AGENT.md',
    // ... custom order
]

📝 Article Conversion Node

Default Settings:

php
'config' => [
    'ai_provider' => 'shareai',
    'min_word_count' => 1200,
    'tone' => 'professional-yet-engaging',
    'target_audience' => 'technical users, developers',
]

Customization Options:

  1. Adjust Content Length:
php
'min_word_count' => 800, // Shorter articles
'max_word_count' => 3000, // Cap length
  1. Change Tone:
php
'tone' => 'casual', // Friendly and conversational
'tone' => 'authoritative', // Expert and formal
'tone' => 'tutorial', // Educational step-by-step
'tone' => 'executive-summary', // High-level overview
  1. Target Different Audiences:
php
'target_audience' => 'beginners, non-technical users',
'target_audience' => 'enterprise decision-makers',
'target_audience' => 'developers and engineers',
  1. Content Structure Options:
php
'include_toc' => true, // Add table of contents
'add_author_bio' => true, // Include author section
'enable_faq_section' => true, // Add FAQ at end
'include_schema_markup' => true, // Structured data

🎨 Image Generation Node

Default Settings:

php
'config' => [
    'image_studio_profile' => 'default',
    'image_dimensions' => ['width' => 1200, 'height' => 628],
    'image_format' => 'wide',
]

Customization Options:

  1. Use Custom Profile:
php
'image_studio_profile' => 'my_custom_profile',
  1. Different Image Formats:
php
// Square format (Instagram-friendly)
'image_format' => 'square',
'image_dimensions' => ['width' => 1080, 'height' => 1080],

// Story format (vertical)
'image_format' => 'story',
'image_dimensions' => ['width' => 1080, 'height' => 1920],
  1. Advanced Image Options:
php
'overlay_opacity' => 0.7, // Background blend
'enable_watermark' => true, // Add brand watermark
'watermark_position' => 'bottom-right',
'font_size_override' => ['title' => 72, 'subtitle' => 36],

📰 WordPress Publishing Node

Default Settings:

php
'config' => [
    'post_status' => 'publish',
    'categories' => ['AI Agents', 'Documentation'],
    'tags' => 'auto-generate',
    'enable_comments' => true,
]

Customization Options:

  1. Change Post Status:
php
'post_status' => 'draft', // Save as draft for review
'post_status' => 'pending', // Pending review
'post_status' => 'private', // Private (hidden)
  1. Custom Categories:
php
'categories' => ['Technology', 'AI', 'Tutorials'],
'primary_category' => 'Technology', // Main category for SEO
  1. Manual Tags:
php
'tags' => ['ai', 'automation', 'productivity', 'tech-guide'],
  1. Additional Options:
php
'author_id' => 5, // Assign to specific user
'post_format' => 'standard', // Or: video, gallery, aside
'scheduled_date' => '+1 day', // Schedule for future
'custom_fields' => [
    'estimated_read_time' => 'auto',
    'difficulty_level' => 'intermediate',
],

🔍 SEO Optimization Node

Default Settings:

php
'config' => [
    'target_seo_score' => 90,
    'min_acceptable_score' => 85,
    'max_optimization_attempts' => 3,
]

Customization Options:

  1. Adjust SEO Targets:
php
'target_seo_score' => 95, // Perfectionist mode
'min_acceptable_score' => 80, // Faster publishing
  1. Optimization Priorities:
php
'optimization_priority' => [
    'keyword_density' => 'high',
    'readability' => 'high',
    'internal_links' => 'medium',
    'external_links' => 'low',
],
  1. Skip Optimization:
php
'skip_optimization' => false, // Set true to skip SEO loop
'publish_immediately' => true, // Bypass checks
  1. Advanced SEO Options:
php
'enable_seo_report_email' => true,
'seo_report_recipients' => ['[email protected]'],
'custom_seo_checklist' => [
    'focus_keyword_in_url' => true,
    'focus_keyword_in_h2' => true,
    // ... custom requirements
],

📱 Social Media Publishing Node

Default Settings:

php
'config' => [
    'platforms' => 'all_connected',
    'post_immediately' => true,
    'generate_platform_specific_copy' => true,
]

Customization Options:

  1. Select Specific Platforms:
php
'platforms' => ['facebook', 'twitter', 'linkedin'],
// Available: facebook, instagram, twitter, linkedin, google_business, tiktok, youtube
  1. Schedule Social Posts:
php
'post_immediately' => false,
'schedule_delay_minutes' => 30, // 30 min after WP publish
  1. Optimal Posting Times:
php
'optimal_times' => [
    'facebook' => '09:00',
    'instagram' => '11:00',
    'twitter' => '13:00',
    'linkedin' => '08:00',
],
  1. Platform-Specific Settings:
php
'facebook_settings' => [
    'post_to_groups' => true,
    'group_ids' => ['123456', '789012'],
    'enable_boost' => false,
],
'instagram_settings' => [
    'post_to_story' => true,
    'story_duration_hours' => 24,
],
'twitter_settings' => [
    'create_thread' => true,
    'thread_tweet_count' => 3,
],
  1. Engagement Tracking:
php
'engagement_tracking' => true,
'track_metrics' => ['likes', 'shares', 'comments', 'clicks'],
'send_engagement_report' => true,
'report_frequency' => 'daily', // Options: daily, weekly

🔧 Advanced Customization

AI Provider Configuration

Change AI Provider for All Nodes:

php
// In workflow template metadata
'ai_provider_override' => 'gemini', // Options: gemini, groq, anthropic, shareai

Per-Node Provider Override:

php
'config' => [
    'ai_provider' => 'groq', // Fast and cost-effective
    'ai_model' => 'llama-3.1-8b-instant',
]

Provider Recommendations:

  • Gemini: Best balance (default)
  • ShareAI: Requested provider, good for complex tasks
  • Groq: Fastest, best for simple tasks
  • Anthropic: Highest quality, more expensive

Conditional Logic

Add Conditional Connections:

php
[
    'from' => 'check_seo_score',
    'to' => 'optimize_seo',
    'condition' => 'seo_score < 90',
],
[
    'from' => 'check_seo_score',
    'to' => 'publish_to_social',
    'condition' => 'seo_score >= 90',
],

Custom Conditions:

php
'condition' => 'word_count > 1500 AND seo_score >= 85',
'condition' => 'publish_status == "publish"',
'condition' => 'featured_image_exists == true',

Error Handling

Configure Failure Behavior:

php
'error_handling' => [
    'on_failure' => 'continue', // Options: continue, stop, retry
    'max_retries' => 2,
    'retry_delay_seconds' => 60,
    'notify_on_error' => true,
    'fallback_action' => 'save_draft', // Save as draft if publish fails
],

Notifications

Configure Notifications:

php
'notifications' => [
    'channels' => ['email', 'slack', 'dashboard'],
    'email_recipients' => ['[email protected]'],
    'slack_webhook' => 'https://hooks.slack.com/...',
    'notify_on_success' => true,
    'notify_on_error' => true,
    'include_summary' => true,
],

📈 Monitoring & Analytics

Track Workflow Performance

Enable Analytics:

php
'analytics' => [
    'track_execution_time' => true,
    'track_api_costs' => true,
    'track_seo_improvements' => true,
    'track_social_engagement' => true,
    'generate_weekly_report' => true,
],

View Workflow Metrics

bash
# View workflow execution history
php artisan workflows:history --workflow="AI Agent Audit Articles"

# Get performance metrics
php artisan workflows:metrics --workflow="AI Agent Audit Articles" --days=30

# Export analytics report
php artisan workflows:export-report --workflow="AI Agent Audit Articles" --format=pdf

🐛 Troubleshooting

Common Issues

1. Workflow Not Triggering

Check schedule:

bash
php artisan schedule:list

Verify cron is running:

bash
# Check system cron
crontab -l

# Should include:
* * * * * cd /var/www/admin.ohm.events && php artisan schedule:run >> /dev/null 2>&1

Test trigger manually:

bash
php artisan workflows:trigger --workflow="AI Agent Audit Articles"

2. File Selection Fails

Verify file paths:

bash
ls -la /var/www/admin.ohm.events/docs/agents/audit/agents/

Check file permissions:

bash
chmod 644 /var/www/admin.ohm.events/docs/agents/audit/agents/*.md

Test file reading:

bash
php artisan tinker
>>> Storage::get('docs/agents/audit/agents/MARKETING_AGENT.md');

3. SEO Optimization Stuck

Check Rank Math plugin:

  • WordPress → Plugins → Rank Math is active
  • Rank Math API is accessible

Lower target score temporarily:

php
'target_seo_score' => 85, // Instead of 90

Skip optimization:

php
'skip_optimization' => true,

4. Postiz Publishing Fails

Check Postiz credentials:

bash
php artisan tinker
>>> app(PostizIntegrationService::class)->getConnectedPlatforms('tenant_id');

Verify platforms connected:

  • Navigate to Settings → Social Media
  • Ensure platforms are connected and authorized

Test Postiz manually:

bash
php artisan postiz:test-connection --tenant=brand_id


💡 Tips & Best Practices

Content Quality

  • Review first few articles manually to ensure quality
  • Adjust tone and style based on audience feedback
  • Monitor engagement metrics to optimize future content

SEO Strategy

  • Research keywords before starting workflow
  • Build internal linking structure as articles accumulate
  • Update older articles with links to newer ones

Social Media

  • Monitor social engagement in first hour
  • Respond to comments quickly
  • Experiment with posting times for your audience

Workflow Optimization

  • Start with conservative settings (draft mode)
  • Gradually increase automation (auto-publish)
  • A/B test different configurations
  • Track which agents/providers perform best

🚀 Next Steps

  1. Install the template (see Quick Start)
  2. Customize settings for your needs
  3. Test with one article manually
  4. Activate daily schedule
  5. Monitor first week of executions
  6. Optimize based on results
  7. Create custom variations for other content

📧 Support

For issues or questions:


Last Updated: January 2, 2026Template Version: 1.0