Project
LinkedIn Post Pipeline
Every Saturday, a Lambda function researches vetted sources, asks Amazon Bedrock to draft five posts, renders an image for each, and emails a review link. Nothing is published until a human approves it, and each approval creates its own one-time EventBridge Scheduler entry for the exact minute that post should go out.
Demo
Weekly Review Simulator
Step through a simulated week. “Generate” plays the Saturday draft run; then approve, decline, or defer each post the way the real review page works. Approving schedules a post for a random time inside the real publishing windows (11:00–16:00 and 18:00–21:00 Eastern).
Privacy notice: nothing is sent anywhere. The sample posts are invented for this demo, and every choice you make lives only in this browser tab until you refresh.
Generate a sample week to see the drafts appear.
Simulates the one-time schedules firing. Only approved posts are ever published.
Architecture
How It Works
One weekly schedule starts the run; everything after that is triggered by a person approving something. Click any icon to jump to that step, or let it play through on its own.
-
1
A Lambda function researches and drafts the week
An EventBridge Scheduler cron entry (Saturday 10:00, Eastern time, daylight saving handled by the scheduler) invokes the Draft function. It reads a curated list of RSS feeds, then makes one Amazon Bedrock call that returns five posts, one per weekday, each tied to that day's subject. It also renders an image for every post.
-
2
Drafts are saved and a review link is emailed
Each post lands in DynamoDB with a
draftstatus and its image goes into a private S3 bucket. SES then emails a link to the review site. The email carries no secret; you have to sign in to see anything. A Sunday reminder fires if anything is still undecided. -
3
A human reviews every post
The review site is a Lambda function behind a Function URL, served through CloudFront at its own address, with Cognito handling sign-in (authenticator-app MFA required) and a 30-day session after that. For each post you can edit the text, redo just the image, regenerate from a note, approve, decline with an optional reason, or defer. Declined reasons from the last eight weeks are fed into new drafts as lessons.
-
4
Approval creates a one-time schedule
Approving a post picks a random minute inside the day's publishing windows and creates an EventBridge Scheduler entry for exactly that minute. It deletes itself after it runs, so nothing polls and nothing sits idle waiting.
-
5
The Publish function posts to LinkedIn
At the scheduled minute, the Publish function reads the access token from an SSM SecureString parameter and calls the official LinkedIn API. A daily 8:45 PM safety sweep publishes any approved post that was somehow missed, and a daily check emails a warning before the roughly 60-day LinkedIn token expires.
Use Cases
Where This Pattern Fits
The interesting part isn't LinkedIn. It's the shape: generate on a schedule, wait for a person, then act at a precise future time.
Content calendars with an approval gate
Marketing or communications teams that want AI-assisted drafts but need a named person to sign off before anything goes public.
Exact-time actions without polling
Anything that must happen at a specific minute chosen later, such as a reminder, a release, or a notification. Create a self-deleting schedule instead of running a job every minute.
Human-in-the-loop automation
Any workflow where a model proposes and a person decides, with the system built so skipping the person is not an option.
Pricing
What This Costs to Run
These are estimates from public list pricing, not a bill. The pipeline is usage-based with nothing always-on, so the model call is the only line item that isn't effectively free.
What drives the cost
- Amazon Bedrock — Claude Sonnet 4.6 lists at $3 per million input tokens and $15 per million output tokens. One full-week draft is roughly 12,000 tokens in and 5,000 out (my assumption), about 11 cents. Regenerating a single post is a couple of cents.
- Lambda, EventBridge Scheduler, DynamoDB, SSM — a few hundred invocations a month, on-demand DynamoDB, and standard SecureString parameters. All inside free tiers or fractions of a cent.
- SES, S3, CloudWatch Logs — a handful of emails ($0.10 per 1,000), five small images a week that expire after 90 days, and one-month log retention. Pennies.
- CloudFront, Cognito, Route 53, ACM — the review site's front door. A single user and a handful of page views a week sit inside the free tiers of CloudFront and Cognito, the TLS certificate is free, and the two DNS alias records live in the hosted zone this account already has.
- Image generation — programmatic text cards cost nothing; the optional Cloudflare Workers AI illustrations use Cloudflare's free tier, outside AWS billing.
Design Decisions
Why I Designed It This Way
A few choices here aren't the only way to build this. Here's the reasoning behind them.
Nothing publishes without approval
Posts go out publicly under a real name, so the pipeline never auto-publishes. An unapproved draft has no schedule attached, and an approved post that is more than 36 hours late is skipped with an email rather than posted stale.
One-time schedules, not a polling job
A job that wakes every minute to check “is anything due?” costs invocations all day to find nothing. EventBridge Scheduler can fire once at an exact minute and then delete itself, so the system is idle between posts.
A Function URL behind CloudFront, with real sign-in
The review site has one user and one purpose, so a Lambda Function URL is enough of a backend and API Gateway would only add a service to run. It started with a long secret token in the emailed link; since that page can approve and schedule public posts, it now sits behind CloudFront at its own domain and requires a Cognito sign-in with an authenticator-app code. The emails no longer contain anything worth stealing.
Least-privilege secrets
The LinkedIn client secret is not readable by any Lambda at all; only the interactive sign-in command uses it. The Publish function can read only the access token, and the Draft function can read only the image-service credentials. Each function's role names the exact SSM parameters it needs.
Pay-per-use everything, and nothing always-on
DynamoDB runs on-demand, Lambda bills per invocation, and images expire from S3 after 90 days. The only meaningful recurring cost is the weekly model call, so the bill follows usage instead of a fixed monthly charge.
Schedules ship disabled until asked
The CDK app creates every schedule in a disabled state unless it is deployed with an explicit flag, so a first deploy can never email or post on its own.
Next Iteration
What I'd Change Next
The gaps I know about: what I'd add before trusting this with real traffic or real data.
Token renewal is still manual
LinkedIn's self-serve apps get no refresh token, so I sign in again about every 60 days. A daily check emails a warning first, but a fully automatic renewal would need a different LinkedIn programme.
Automated tests
The pipeline has dry-run scripts that exercise the real feeds and model without posting, but no automated tests. I'd add tests around approval and scheduling, since those are the rules that matter most.
Architecture Diagram
Full Architecture Diagram
The complete AWS architecture diagram for this project, built with draw.io. The numbered arrows match the five steps above. Click it to expand full screen.