# Archive published WordPress articles in R2

Capture the published WordPress permalink and save its rendered Markdown and desktop screenshot together in an R2 bucket.

[Use template](https://dashboard.fasthook.io/workflow/new?templateKey=wordpress-published-snapshots-to-r2&templateName=Archive+published+WordPress+articles+in+R2)

**Required accounts**

- Cloudflare Browser Run
- Cloudflare R2
- Http

## Archive published WordPress articles in R2

### 1. Trigger · WordPress publish notification received

**Webhook**. Receive a JSON submission from your existing form backend at this Workflow's private webhook URL.

### 2. Transformation · Identify the published revision

**FastHook**. Run JavaScript to prepare data for the next workflow step.

### 3. Action · Read the published article as Markdown

**Cloudflare Browser Run**. Convert the rendered article or page to text that preserves headings and links.

### 4. Action · Prepare a temporary R2 upload for the article

**Cloudflare R2**. Create an expiring URL for one object.

### 5. Action · Archive the Markdown revision

**Http**. Send an HTTP request and use the response in subsequent steps.

### 6. Action · Capture the published article

**Cloudflare Browser Run**. Capture a page or selected element at the viewport size you choose.

### 7. Action · Archive the rendered screenshot

**Cloudflare R2**. Run the R2 S3-compatible PutObject operation.

## Set up your workflow

1. **Send a WordPress publication notice** Configure the WordPress.com publish\_post webhook to send ID, post\_url, post\_status and post\_modified\_gmt to the private FastHook webhook. On plugin-enabled sites, configure the equivalent publication notification.
2. **Select the site and bucket** Connect Browser Run and give it a public article URL. Select the same bucket in Prepare a temporary R2 upload for the article and Archive the rendered screenshot. The Markdown upload URL expires after five minutes.
3. **Check the archived revision** Publish a test article. Under wordpress/\<post ID\>/\<modified time\>/, open article.md and desktop.png and confirm that both show the published revision.

## Related integrations

- [Webhook trigger](https://www.fasthook.io/docs/triggers/webhook)
- [Cloudflare Browser Run integrations](https://www.fasthook.io/apps/cloudflare-browser-run/integrations)
- [Cloudflare R2 integrations](https://www.fasthook.io/apps/cloudflare-r2/integrations)

## Related workflow templates

- [Archive newly issued origin certificates in R2](https://www.fasthook.io/templates/origin-ca-issued-certificates-to-r2.md): Sign a CSR for a configured origin hostname and save the signed PEM in R2 under its serial number.
- [Share desktop and mobile deployment previews in Slack](https://www.fasthook.io/templates/webhook-deployment-screenshots-to-slack.md): Render the deployed page at two viewport sizes and attach both PNGs to one Slack message.
- [Archive an R2 object in Dropbox](https://www.fasthook.io/templates/cloudflare-r2-object-to-dropbox.md): Send a bucket, object key and Dropbox path to copy the original bytes.
