Lifestyle Hikers Content Distribution Automation
This repo now supports a single source-of-truth flow for announcing hikes and blog posts from the CMS.
Architecture
Sveltia/Decap CMS
-> GitHub commit to main
-> Content Distribution Webhook GitHub Action
-> scripts/build_content_distribution_payload.rb
-> n8n webhook
-> Telegram and Brevo
Hikes live in _data/events.yml.
Blog posts live in _posts/.
The website does not render the new automation fields. Existing homepage hike cards and blog pages should continue to behave the same way.
Live n8n Workflows
The live webhook distributor is:
Lifestyle Hikers Content Distributor, workflow IDNNQgOBo7m5sOKzue- Webhook path:
lifestyle-hikers-content-distributor - Current status: active
It reuses proven pieces from these existing workflows:
Hike Announcement Auto-Broadcaster, workflow IDIlWbcMoDLTHVDPKELifestyle Hikers Telegram Updates, workflow IDuMs9wPpFYVksCxfz
The older workflows are preserved so they can be compared or rolled back if needed.
Required GitHub Secrets
Set these in the GitHub repository settings:
N8N_CONTENT_WEBHOOK_URL: production n8n webhook URL for the content distributor workflowLH_WEBHOOK_SECRET: shared secret checked by n8n from theX-LH-SECRETheaderLIFESTYLE_HIKERS_SITE_URL: usuallyhttps://www.lifestylehikers.com
Optional GitHub repository variable:
CONTENT_DISTRIBUTION_DRY_RUN: currently set totruewhile testing
CMS Fields
Hikes have these optional automation fields:
flyerregistration_urldistribution_statusannouncement_idsend_to_telegramsend_to_brevoannouncement_sent_attelegram_sentbrevo_senttelegram_message_idbrevo_message_idannouncement_error
Blog posts have these optional automation fields:
distribution_statusannouncement_idsend_to_telegramsend_to_brevoannouncement_sent_attelegram_sentbrevo_senttelegram_message_idbrevo_message_idannouncement_error
Publishing A Hike Announcement
- Open the CMS.
- Edit
Upcoming Hikes. - Fill in the normal hike details.
- Add a flyer and registration link if available.
- Set
Distribution StatustoReady. - Leave
Send to Telegramon. - Leave
Send to Brevoon if the email should go out. - Publish the CMS change.
The GitHub Action will only build payloads for hikes where distribution_status: ready.
Publishing A Blog Telegram Announcement
- Open the CMS.
- Create or edit a blog post.
- Add the title, slug, date, description, image, and body.
- Set
Distribution StatustoReady. - Leave
Send to Telegramon. - Leave
Send to Brevooff unless blog email delivery has been explicitly configured in n8n. - Publish the CMS change.
The GitHub Action only builds blog payloads for changed blog posts where distribution_status: ready.
Dry Run
Dry run mode builds payloads without sending to n8n.
Use one of these:
- Run the workflow manually and leave
dry_runastrue. - Set the repository variable
CONTENT_DISTRIBUTION_DRY_RUNtotrue.
Local dry-run examples:
ruby scripts/build_content_distribution_payload.rb --root . --changed-files "_data/events.yml"
ruby scripts/build_content_distribution_payload.rb --root . --changed-files "_posts/2026-02-15-kwame-falls-first-hike-2026.md"
n8n Webhook Contract
n8n should:
- Accept
POSTrequests from the GitHub Action. - Validate the
X-LH-SECRETheader. - Reject missing or invalid shared secrets.
- Route by
content_type. - Check duplicate sends by
announcement_id. - Send Telegram for hikes and blogs when
send_to_telegramis true. - Send Brevo for hikes when
send_to_brevois true. - Keep Brevo disabled for blog posts unless intentionally configured.
- Log every result safely without storing secrets.
Recommended log fields:
announcement_idcontent_typetitleornamesource_filesource_commit_shatelegram_statustelegram_message_idbrevo_statusbrevo_message_idsent_atlast_error
Telegram Behavior
For hikes:
New Lifestyle Hikers Adventure
Date:
Time:
Location:
Difficulty:
Distance:
Spots:
Register:
For blogs:
New Lifestyle Hikers Blog Post
Read here:
Current live behavior uses Telegram sendMessage. If a flyer or image exists, the image URL is included in the message text.
A later upgrade can switch this to Telegram sendPhoto after testing against a private Telegram test channel.
Brevo Behavior
For hikes, Brevo email should include:
- hike name
- flyer image if available
- date
- time
- location
- difficulty
- distance
- spots
- description
- registration link
Use test-recipient mode before sending to the live list.
Duplicate Protection
The GitHub Action may rerun, and CMS edits may happen more than once. n8n must treat announcement_id as the idempotency key.
If the same announcement_id has already succeeded, n8n should skip sending and return a safe success response.
Troubleshooting
If nothing sends:
- Confirm
distribution_statusis exactlyready. - Confirm the changed file is
_data/events.ymlor a file inside_posts/. - Confirm the GitHub Action was not in dry-run mode.
- Confirm
N8N_CONTENT_WEBHOOK_URLandLH_WEBHOOK_SECRETare set. - Confirm the n8n workflow is active and its production webhook URL is being used.
If Telegram fails:
- Confirm the
Lifestyle Hikers Botcredential still exists in n8n. - Confirm the bot is still admin in the target Telegram channel.
- Confirm the Telegram chat ID is correct.
If Brevo fails:
- Confirm the Brevo credential still exists in n8n.
- Confirm the sender is verified.
- Confirm the workflow is using a test recipient before live list delivery.