Affinity Design
Agency Guide

Website Editor

How website execution jobs work — bounded edits, preview flow, approval, and audit trails

How Website Execution Works

The Website Editor uses a canonical execution platform for all connected website work. Whether triggered by an admin operator or handed off from the SEO agent, every change follows the same persisted job record, transport policy, and lifecycle semantics.

No live mutation happens without a bounded, previewed, and approved job. The platform never makes unbounded or wildcard edits to any site.

Transport Modes

Website jobs run through one of two transport modes:

ModeDescriptionDefault ApprovalBackup
wordpress-liveDirect writes to a connected WordPress sitepreview_requiredRequired by default
github-prCommit-first to a working branch, optional PR promotionpreview_requiredN/A

WordPress live edits must declare bounded allowedTargets[]. Wildcards like *, /, all, or site-wide are rejected by policy.

WordPress Live Mode

  • Writes go directly to the connected WordPress REST API
  • Targets must be explicitly bounded (specific pages, posts, or elements)
  • riskLevel is mandatory — classify the change explicitly
  • Backups are required by default
  • Previews are generated before execution

GitHub PR Mode

  • Commits to a configured working branch (never main or master)
  • Direct writes to the repo default branch are rejected by policy
  • Pull request creation is optional (createPullRequest: true)
  • Promotion to main is a separate PR step
  • The connected GitHub connection carries the working branch preference (e.g., test)

Job Lifecycle

Every website execution job moves through these states:

StatusMeaningOperator Action
draftJob exists, no preview yetSafe to edit inputs
preview_readyPreview metadata availableInspect targets and blocked reasons
queuedAccepted for worker executionWait for completion
runningWorker actively executingMonitor heartbeats
review_requiredExecution produced a review artifactReview and approve
completedFinished successfullyCheck result metadata
failedTerminally failedCheck lastError
cancelledIntentionally cancelledNo further action

Preview and Result Artifacts

Preview (Pre-Execution)

Before any change is applied, the system generates a preview artifact containing:

  • Summary — what the job plans to do
  • Warnings[] — any concerns detected
  • BlockedReasons[] — why execution may be blocked
  • BackupRef — reference to the pre-change backup
  • RequiresBackup — whether a backup was created
  • Operations[] — typed list of planned operations

Result (Post-Execution)

After execution, the result artifact includes:

  • Summary — what was done
  • Status — final execution status
  • ErrorMessage — if applicable
  • BranchName / CommitSha — for GitHub transport
  • PullRequestUrl — if a PR was created
  • DestinationUrl — live URL of the changed resource
  • BackupRef — for rollback if needed
  • Operations[] — typed list of completed operations

Approval Flow

  1. Operator creates a job — defines objective, targets, and transport
  2. System generates preview — job moves to preview_ready
  3. Operator reviews preview — inspects planned operations, warnings, and blocked reasons
  4. Operator approves — job moves to queued for worker execution
  5. Worker executes — job moves to running, then completed or failed
  6. If review required — job pauses at review_required for final sign-off

Never report inline completion when a job is only queued or pending review. The operator must see truthful status at every step.

SEO Agent Handoff

The SEO agent can create website execution jobs when it has resolved executable inputs:

  • Blog posts are queued as WordPress drafts (operation: "write_entity", postType: "post", status: "draft")
  • Money-page edits go through the same bounded execution contract
  • The SEO runtime cannot call WordPress or GitHub mutation helpers directly — it must create a job

If the SEO agent cannot fully resolve a bounded execution payload, it returns a recommendation instead of creating a job. Partial or unbounded edits are never submitted.

Supported SEO Operations

SourceJob TypeTransport
Auto-bloggerWordPress draft postwordpress-live
Money-page optimizationPage content updatewordpress-live
Elementor smart editsWidget-scoped editwordpress-live
Technical SEO fixesConfiguration changewordpress-live or github-pr

Bounded Execution

Every job must declare:

  • allowedTargets[] — what the job is permitted to modify (cannot be empty or contain wildcards)
  • blockedTargets[] — explicit guardrails for sensitive areas
  • changeRequest — typed request with kind, summary, and structured payload
  • objective — human-readable bounded scope for the job

Freeform prompt blobs are not accepted as the executable contract. Every change must be structured and typed.

Activity and Audit Trail

Every lifecycle transition emits a shared website activity record:

EventMeaning
website_execution.job.createdJob persisted for the first time
website_execution.job.preview_readyPreview artifact available
website_execution.job.queuedJob accepted into the queue
website_execution.job.runningWorker claimed the lease
website_execution.job.review_requiredReview artifact ready
website_execution.job.completedExecution succeeded
website_execution.job.failedExecution failed
website_execution.job.cancelledJob was cancelled
wordpress.entity.writeWordPress entity created or updated
wordpress.taxonomy.assignWordPress taxonomy mutation
wordpress.elementor.planElementor smart plan emitted
wordpress.elementor.applyElementor smart apply completed
github.change_set.appliedGitHub branch change set committed
github.pull_request.createdPull request opened

Activity status values follow the shared four-level contract: info, success, warning, error.

Managing Jobs

Via Admin UI

  1. Navigate to the client's website section
  2. Review pending jobs in the execution queue
  3. Inspect preview artifacts before approving
  4. Approve or reject queued jobs
  5. Monitor running jobs via heartbeat status

Via API

# List jobs for a client
GET /admin/website-execution/jobs?clientId=CLIENT_ID

# Get job detail with preview
GET /admin/website-execution/jobs/JOB_ID

# Approve and queue a previewed job
POST /admin/website-execution/jobs/JOB_ID/approve

# Cancel a queued or running job
POST /admin/website-execution/jobs/JOB_ID/cancel

Troubleshooting

IssueResolution
Job stuck in queuedWorker may not be running — check heartbeat status
allowedTargets rejectedRemove wildcards and specify exact targets
Preview shows blocked reasonsAddress the listed blockers before approving
WordPress write failsVerify REST API credentials and permissions
GitHub push rejectedConfirm working branch exists and token has write access
Backup not createdCheck backupRequired is true and backup storage is configured

On this page