
AI-Powered Media Planning & BPMN Process-as-a-Service
An enterprise-grade workflow orchestration platform with AI agent functions, multi-channel integrations, and automated media planning workflows.

The 8 core functions defined in the Paid Optimization Workflow Outline
Budget distribution across channels
ImplementedPerformance prediction using benchmarks
ImplementedUnified targeting recommendations
ImplementedStandardized naming conventions
ImplementedDetailed flighting calendar
ImplementedReal-time spend & KPI monitoring
ImplementedBudget rebalancing based on performance
ImplementedWoW analysis & strategic insights
ImplementedGoogle, Meta, LinkedIn, TikTok, GA4, CRM
Camunda v7 OSS engine with AI generation
MMM Allocator, Predictive Engine
Persona-based dashboards & DoA

8 BPMN Workflow Steps + 6 CortexOne AI Agents (All Published)
Budget allocation
Performance prediction
Target segments
Campaign structure
Assets & messaging
Real-time pacing
Budget rebalancing
Performance reports
ML forecasting
Bayesian optimization
Auto-execution
CAPI validation
Lift measurement
Unified read API

Production-ready integrations with error handling, validation, and retry logic
Campaign management
Facebook & Instagram
B2B advertising
Short-form video ads
Attribution & analytics
Customer data sync
Docs, Sheets, Slides
Shared utilities

Rival Platform Foundation + Poetry Domain Layer
Claude-powered automation
Visual process orchestration
300+ ad platform docs
Cloud Build + Cloud Run

Generate complete BPMN processes from natural language using Claude
"Media planning workflow
with parallel approvals"
BPMN generation rules
+ validation
Complete process
+ diagram coordinates

Automated BPMN deployment integrated with GitHub
AI generates BPMN
BPMN validator checks
Git branch + PR
Auto-deploy to Camunda
processes/ (experiment) → packages/bpmn/ (promote) → CI/CD (deploy)
New processes start in processes/ for experimentation.
Once validated, they're promoted to the @rival/bpmn package for automated deployment.
Auto-commit, branch management, PR creation
13 rules ensure Camunda 7 compatibility
Seamless deployment to Camunda v7 engine

Real example: RIV-337 completed autonomously in a single Claude Code session

Monorepo with 10+ packages
React web app with App Router
TypeScript backend with DI
BPMN engine with REST API
Enterprise authorization
Runtime API validation
Accessible UI components
End-to-end testing
Alpine-based database
Type-safe database access
Cache and sessions
Spring animations
Neo4j + pgvector
Containerized stack

rival/ ├── apps/ │ └── web # Next.js dashboard ├── packages/ │ ├── api # NestJS REST API │ │ └── test/fixtures/ # BPMN test fixtures (CI/CD) │ ├── bpmn # Production BPMN (@rival/bpmn npm package) │ ├── workers # Camunda workers (5 planning) │ ├── authority-management # Enterprise Authorization │ └── integrations/ │ ├── core # Shared utilities │ ├── google-ads # Google Ads API │ ├── meta-ads # Meta/Facebook API │ ├── linkedin-ads # LinkedIn Marketing │ ├── tiktok-ads # TikTok Ads API │ ├── ga4 # Google Analytics 4 │ ├── crm # CRM integration │ └── google-workspace ├── functions/ # CortexOne AI agents └── processes/ # BPMN scratch/experimentation (local dev)

Secure, multi-tenant file storage with enterprise compliance controls
No service account keys in Cloud Run. Uses GCP Workload Identity for zero-credential access to GCS buckets.
Tamper-proof audit logs with cryptographic signatures. Every upload, download, and delete is immutably recorded.

Next.js 15 dashboard with enterprise-grade features
Full ARIA support, keyboard navigation
Content Security Policy, HSTS
Runtime validation with type-safe client
Unit tests + E2E with Playwright
Interactive process diagram viewer
Mock data layer for development
7 role-specific views with proactive insights
Cmd+K shortcut with Neo4j Knowledge Base
Enterprise delegation of authority

AI-Powered Campaign Optimization Agents (GCP Python 3.13 Runtime) - All 6 Published ✓
Actions: ROAS forecasting, creative fatigue, audience saturation
✓ Published ($0.01)
Actions: CAPI signal quality, privacy-compliant validation
✓ Published ($0.01)
Actions: Auto-execute with budget guardrails & safety limits
✓ Published ($0.01)
Actions: Bayesian budget optimization, Media Mix Modeling
✓ Published ($0.01)
Actions: Geo-holdout, synthetic control, Bayesian lift
✓ Published ($0.01)
Actions: Unified read API for Google & Meta campaigns
✓ Published ($0.01)
6/6 functions published at cortexone.rival.io | API-invokable via BPMN workflows | $0.01/call pricing

Poetry: World-Class Client Experience
Identity Drives Experience
Social login + Magic Link + Enterprise SSO detection

Context-Aware Intelligence at Your Fingertips
Global shortcut
from any page
Persona-filtered
responses
Markdown + syntax
highlighting
720+ nodes, 665+ relationships, TOGAF ontology
Role-based knowledge filtering via graph
Context-aware question prompts
Thumbs up/down for continuous improvement

Manager
Director
CMO
👍/👎
AI Sentiment
Notify User

Poetry Domain Knowledge Graph - Interactive 2D Visualization

3D Immersive Ontology Visualization

In Regulated Industries, Advertising IS Compliance
Poetry builds compliance into the platform from day one—
a strategic advantage for us and
a competitive edge for our clients.

SEO → AEO (Agent Experience Optimization)
Optimize for
human clicks
Optimize for
AI retrieval + actions
Schema.org Product, Organization & LocalBusiness vocabularies in JSON-LD so AI reads meaning, not just words
SSR for crawlable content, clean canonical URLs, XML sitemaps, /llms.txt declarations
RFC 9309 robots.txt compliance, WAF-level enforcement, rate limiting & selective access
AI Preferences working group (aipref) for site-level machine-readable policy declarations
Real-time product APIs, structured commerce feeds enabling AI agents to browse & transact
AI referral traffic, LLM citation tracking, bot crawl analytics & AI-driven attribution
As AI shopping agents become the new top-of-funnel, Poetry positions brands to be discoverable, trustworthy, and actionable for both human users AND AI retrieval bots.

Rival Platform - Agentic SDLC Metrics
8 SubAgents automating the full software development lifecycle
Generated: 2025-12-21 | Data refreshed on demand via /dev-summary

Docker Compose Infrastructure - 13 Services
| Service | Port | Info |
|---|---|---|
| ● rival-api | 3000 | |
| ● rival-web | 3001 | |
| ● rival-cib7 | 8080 | |
| ● rival-workers | — | |
| ● rival-cortexone | 8082 | |
| ● rival-knowledge-base | 8000 | |
| ● rival-voice-agent | 8081 | |
| Cloud Services: LiveKit Cloud (voice/video) • OPA WASM (embedded in API) | ||
| ● rival-postgres | 5432 | |
| ● rival-neo4j | 7474 | |
| ● rival-redis | 6379 | |
| ● rival-minio | 9000 | |
Start: docker compose -f docker-compose.local.yml up -d | Stop: ./scripts/stop.sh

Google Cloud Platform - 13 Services (Matching Dev)
| Service | Platform | Cost |
|---|---|---|
| ● rival-api | Cloud Run | ~$5 |
| ○ rival-web | Cloud Run | (future) |
| ● rival-cib7 | GKE | ~$25 |
| ○ rival-workers | Cloud Run | (future) |
| ● rival-cortexone | External API | usage |
| ○ rival-kb | Cloud Run | (future) |
| ○ rival-opa | Cloud Run | (future) |
| ○ rival-livekit | LiveKit Cloud | (future) |
| ● postgres | Consolidated (rival + camunda) | $0 |
| ● rival-neo4j | GKE Container | ~$5 |
| ● rival-redis | Upstash Free | $0 |
| ○ rival-storage | Cloud Storage | (future) |
| Running | ~$35/mo | |
| Stopped | $0/mo | |
Start: ./infrastructure/gcp/scripts/start-cluster.sh | Stop: ./scripts/stop-cluster.sh | Stopped = $0/mo

Enterprise-Grade GCP Deployment - HA/DR Ready
| Component | Configuration | Cost |
|---|---|---|
| ● Cloud Run API | Multi-region, min 2 instances | ~$100 |
| ● GKE Regional | 3 zones, 2-5 nodes/zone | ~$200 |
| ● Cloud SQL HA | Multi-zone, auto-failover | ~$150 |
| ● Neo4j Enterprise | Causal cluster, 3 nodes | ~$300 |
| ● Memorystore | Redis HA, auto-failover | ~$80 |
| ● Cloud Armor | WAF, DDoS protection | ~$50 |
| ● Secret Manager | Encrypted secrets, audit log | ~$5 |
| Estimated Total | ~$900/mo | |
Infrastructure-as-Code: Terraform modules in infrastructure/terraform/

Real-Time Performance Intelligence Powered by AI
Dashboard available at /campaigns/dashboard • Data refreshes every 15 minutes

6,500+ Records for Demo, Testing & QA
State rules • Responsible gaming • GeoComply • HITL reviews
50+ institutions • Gainful employment • Lead gen consent
Seed command: pnpm --filter @rival/db seed • Located in packages/db/prisma/seeds/

Complete workflow from campaign inception to creative brief with AI + DMN governance
AI Proposes → DMN Decides → Human Approves → BPMN Enforces

Orchestrated workflow with DMN governance gates at each decision point
Process: plan-campaign.bpmn • Work Item: RIV-224

Policy-as-code governance with auditable decision logic
| Input | Rule |
|---|---|
| Privacy Framework | GDPR/CCPA required |
| Tracking Enabled | +30 pts if true |
| Client Tier | Min budget by tier |
Hit Policy: COLLECT (SUM)
| Tier | Range | Max Δ |
|---|---|---|
| Enterprise | $50K-$10M | 50% |
| Growth | $10K-$500K | 30% |
| Starter | $1K-$50K | 20% |
Hit Policy: FIRST
| Metric | Threshold |
|---|---|
| Confidence Score | ≥ 0.70 |
| Variance | ≤ 25% |
| Coverage | ≥ 80% |
Hit Policy: FIRST
| Check | Rule |
|---|---|
| Data Sources | 1st/2nd party only |
| PII Handling | Hashed required |
| Consent | Explicit opt-in |
Hit Policy: COLLECT
| Level | Pattern |
|---|---|
| Campaign | [Client]_[Obj]_[Date] |
| Ad Set | [Audience]_[Geo] |
| Ad | [Format]_[CTA]_v# |
Hit Policy: FIRST
| Budget | Approver |
|---|---|
| < $25K | Manager |
| $25K-$100K | Director |
| > $100K | VP/C-Level |
Hit Policy: FIRST
Location: packages/bpmn/poetry/decisions/ • 34 DMN files total

Complete workflow executed via Rival Functions API + Camunda 7 orchestration
poetry-media-mix → mmm-allocator (real API)
poetry-forecasting → predictive-engine (real API)
poetry-audience, poetry-framework, poetry-creative-brief
Generate mock DecisionProposal when API unavailable
Process Instance: 364acb4f-e08c-11f0-9d52-f63bc50e7e8b • Business Key: demo-e2e-final

Two complementary decision engines for different purposes
Purpose: Business rules & regulatory compliance
Audience: Business analysts, compliance officers
Editing: Visual table editor (Camunda Modeler)
Integration: Native BPMN (businessRuleTask)
Purpose: Authorization & access control
Audience: Developers, security engineers
Editing: Code editor (Rego language)
Integration: REST API or WASM (in-process)
DMN: packages/bpmn/poetry/decisions/ | OPA: packages/authority-management/policies/
This section documents the original 8 core functions defined in the client's "Paid Optimization Workflow Outline" spreadsheet. These are the baseline requirements against which all development is measured.
| # | Function | Original Description | Status | Implementation |
|---|---|---|---|---|
| 1 | Media Mix Allocation | Budget distribution across channels (Meta, YouTube, Search, Programmatic, TikTok, LinkedIn, X) based on objectives, audiences, seasonality, and media approach | IMPLEMENTED | packages/workers/src/planning/media-mix.worker.ts |
| 2 | Media Forecasting | Predicts expected campaign performance using industry benchmarks, platform data, and historical results (CPM, CPC, CPE, CPV, CPL, ROI) | IMPLEMENTED | packages/workers/src/planning/forecasting.worker.ts |
| 3 | Audience Identification | Analyzes channel targeting capabilities and produces unified targeting recommendation (interest groups, demographics, job titles, retargeting pools, lookalikes) | IMPLEMENTED | packages/workers/src/planning/audience.worker.ts |
| 4 | Campaign Naming Generator | Creates consistent, searchable campaign names following unified naming structure | IMPLEMENTED | packages/workers/src/planning/framework.worker.ts |
| 5 | Campaign Flighting | Transforms forecast and mix allocation into detailed flighting calendar | IMPLEMENTED | packages/workers/src/planning/framework.worker.ts |
| # | Function | Original Description | Status | Implementation |
|---|---|---|---|---|
| 6 | Daily Optimization | Real-time spend/KPI monitoring, overspend/underspend detection, automated budget recommendations | IMPLEMENTED | packages/workers/src/poetry/daily-optimization.worker.ts |
| 7 | Weekly Reallocation | 7-day performance review, budget rebalancing, learning phase awareness | IMPLEMENTED | packages/workers/src/poetry/weekly-reallocation.worker.ts |
| 8 | Weekly Performance Snapshot | WoW analysis, creative performance signals, strategic insights email | IMPLEMENTED | packages/workers/src/poetry/snapshot.worker.ts |
All 8 functions require integration with:
| Category | Implemented | Remaining | Coverage |
|---|---|---|---|
| Planning Flow | 5/5 | 0 | 100% |
| Monitoring Flow | 3/3 | 0 | 100% |
| Total | 8/8 | 0 | 100% |
The goal is to build an automated agentic workflow for optimizing paid media campaigns. This system will ingest user constraints, historical data, and live performance metrics to recommend budget allocations, forecast performance, assist with audience targeting, flighting, and ongoing optimization (daily and weekly).
Version 1.0 (MVP) focuses on 8 core agents for market launch with recommendation-based workflows. Enhanced capabilities including predictive intelligence, incrementality testing, and autonomous execution are planned for subsequent releases (see Section 2.1 Release Roadmap).
The system is composed of 8 Core Functions or "Agents" that handle specific parts of the paid media lifecycle:
Goal: Operational paid media workflow with core planning and optimization
| # | Agent | Function | Priority |
|---|---|---|---|
| 1 | Media Mix Allocation | Budget distribution across channels | P0 |
| 2 | Media Forecasting | Performance prediction using benchmarks | P0 |
| 3 | Audience Identification | Targeting recommendations | P0 |
| 4 | Campaign Framework | Flighting & naming conventions | P0 |
| 5 | Creative Brief | Asset management & assignment | P0 |
| 6 | Daily Optimization | Real-time monitoring & recommendations | P0 |
| 7 | Weekly Reallocation | Budget rebalancing | P0 |
| 8 | Weekly Performance Snapshot | Strategic reporting | P0 |
Execution Mode: Recommendation-only (human approval required for all changes)
Goal: Add predictive capabilities and advanced measurement
| # | Agent | Function | Business Value |
|---|---|---|---|
| 9 | Predictive Performance Engine | ROAS forecasting, fatigue prediction | Prevent 30-50% performance drops |
| 10 | Incrementality Testing Orchestrator | Causal measurement, geo tests | Identify 20-40% wasted spend |
| 11 | MMM-Driven Allocator | Marketing Mix Model integration | 5-15% efficiency gains |
Goal: Enable autonomous optimization with human oversight
| # | Agent | Function | Business Value |
|---|---|---|---|
| 12 | Autonomous Execution Engine | Direct platform API execution | 11% uplift, 30+ hrs/wk savings |
| 13 | Privacy-First Measurement Manager | Server-side tracking, Conversion APIs | Future-proof for cookie deprecation |
Safety Controls: Max change limits, anomaly detection, 15-min human veto window
| # | Agent | Function |
|---|---|---|
| 14 | Cross-Channel Attribution Manager | Multi-touch journey mapping, Shapley value attribution |
| 15 | Audience Learning System | Auto-expand/contract audiences based on performance |
| 16 | Dynamic Creative Optimization (DCO) Engine | AI-generated creative variants |
| 17 | Competitive Intelligence Monitor | Competitor spend and creative tracking |
Scope: Version 1.0 (MVP) - All agents below are targeted for initial market launch
Goal: Determine how budget should be allocated across channels based on constraints and historical data.
Goal: Forecast performance outcomes based on the allocated mix using industry benchmarks.
Goal: Identify and recommend target audiences using platform targeting capabilities.
Goal: Structure the campaign flighting and naming conventions.
Goal: Manage creative assets and their assignment.
Goal: Monitor daily spend and KPIs, making real-time adjustments.
Goal: Rebalance budgets weekly to hit monthly targets efficiently.
Goal: Summarize weekly performance and provide strategic insights.
Enterprise client portal with:
V2: Predictive Performance Engine, Incrementality Testing, MMM-Driven Allocator
V3: Autonomous Execution Engine, Privacy-First Measurement Manager
V4: Cross-Channel Attribution, Audience Learning System, DCO Engine, Competitive Intelligence
Research-backed performance targets based on 2024-2025 industry data.
| Metric | Industry Baseline | Poetry Target | Improvement |
|---|---|---|---|
| Time to build media plan | 8-12 hours | <30 min | 96%+ reduction |
| Planning completion rate | 40-60% | >80% | 50%+ improvement |
| Recommendation acceptance | N/A (manual) | >70% | AI-enabled |
| Client NPS | 25-35 (agency avg) | >50 | 50%+ improvement |
| Metric | Industry Average | Poetry Target | Improvement Goal |
|---|---|---|---|
| Search CTR | 6.11% | 7.5%+ | +23% |
| Search CPC | $4.22 | <$3.80 | -10% |
| Search Conversion Rate | 7.04% | 8.5%+ | +20% |
| Display CTR | 0.46% | 0.55%+ | +20% |
| Metric | Industry Average | Poetry Target | Improvement Goal |
|---|---|---|---|
| CTR | 1.49% | 1.85%+ | +24% |
| CPC | $0.40-$0.65 | <$0.55 | -15% |
| Conversion Rate | 8.25% | 10%+ | +21% |
| CPM | $5-$15 | <$10 | Optimized reach |
| Metric | Industry Average | Poetry Target | Improvement Goal |
|---|---|---|---|
| CTR | 0.84% | 1.0%+ | +19% |
| CPM | $9.16 | <$8.00 | -13% |
| Engagement Rate | 5.96% | 7.0%+ | +17% |
| Video Completion | 60-70% | >75% | +10% |
| Metric | Industry Average | Poetry Target | Improvement Goal |
|---|---|---|---|
| CTR | 0.35-0.65% | 0.8%+ | +40% |
| CPC | $5.39-$8.00 | <$5.00 | -25% |
| Conversion Rate | 6.1% | 7.5%+ | +23% |
| InMail Open Rate | 52% | >60% | +15% |
| Metric | Industry Research | Source | Poetry Target |
|---|---|---|---|
| Marketing Automation ROI | 544% average | Nucleus Research | 600%+ |
| Time Savings | 300+ hours/year | Salesforce | 400+ hours |
| Campaign Performance | 25-40% improvement | McKinsey Digital | 35%+ |
| Manual Task Reduction | 60-80% | Gartner | 75%+ |
| Decision Speed | 3x faster | Forrester | 4x |
Document Version: 2.1 | Last Updated: 2025-12-22 | Status: Active - Research-Backed KPIs Added