AWS Builder Center
Weekend Showcase Challenge: Nocturne FM — The Request Line

Weekend Showcase Challenge: Nocturne FM — The Request Line

An always-on radio station that broadcasts to an empty room every two hours — and now cuts you a personal dedication in about forty seconds if you ask it to. Built on AWS Lambda, EventBridge, Polly, DynamoDB and S3.

The vision, and what it does

Nocturne FM is a radio station that broadcasts from Karachi to an audience that may be asleep.
Every two hours, Amazon EventBridge wakes a Lambda. It reads the real sky over the city, writes a show and the musical score to go underneath it in a single model call, synthesizes that score sample-by-sample in pure Python, hands the script to Amazon Polly, mixes voice over music, and publishes a finished episode to Amazon S3. Nobody requests it. Nobody presses play. It has been doing this on its own since August.
The problem it solves is a small and slightly stubborn one: almost everything we build waits to be asked. A prompt box sits there doing nothing until a human arrives. I wanted the opposite — something that produces whether or not anyone shows up, and that has a history you can arrive in the middle of.
Which created the problem I spent this weekend fixing. A station nobody can talk to is a beautiful demo and a lonely product. The August build was deliberately powerless from the outside: you could pin a word to a request board, but nothing you did could put the station on air. Only the schedule could, and keeping that door shut was the entire point of "set your creative app free."
So the showcase build adds exactly one door, and keeps it narrow. The station now takes requests. You give it a word, optionally dedicate it to someone, and press Request live. Roughly forty seconds later there is a new episode — a short dedication, written for you, scored, spoken, and on air — while the scheduled broadcast carries on completely undisturbed.

Pin to board
Request live
Who acts
the schedule
you
When it airs
next scheduled show, up to 2h
~40 seconds
What you get
your word woven into the hour
a dedication of your own
Touches station memory
yes — feeds the self-critique loop
no
That last row is the design decision I care most about. The scheduled show ends every episode by writing itself a note of honest self-criticism, which it is shown again next time and expected to have acted on. That loop is how the station gets better hour after hour. A dedication borrows the microphone — it does not get a vote on how the station writes tomorrow.

How I built it

I started from my own August build rather than a blank folder, which is what this weekend was for. The first thing I did was re-read code I had written a week earlier, and the useful shock was finding a comment I had left on  next_episode_number()  explaining that it allocated episode numbers atomically via DynamoDB's  ADD  because "two overlapping runs would both publish episode seven." At the time that was theoretical — only EventBridge could call it, and broadcasts were hours apart. The request line made it load-bearing overnight: a listener can now press the button while the scheduled producer is already mid-render. Defensive code I nearly deleted as over-engineering became the thing that made the feature safe.
Key decision one: the request line renders nothing.  StationFunction  is a 256 MB, 15-second web tier. A dedication takes 40–90 seconds. So the endpoint validates, rations, writes a request record, and calls the producer with  InvocationType="Event"  — fire and forget. The browser then polls  GET /api/request?id=… , and rather than spinning a meaningless loader, the page names the stage the station is actually in: on the line → writing your dedication → scoring and speaking it → on air.
Key decision two: a second writer, not a flag. My first instinct was to add a  short=True  parameter to the existing prompt. I backed that out. The scheduled show writes into the dark and knows nobody is listening; a dedication knows exactly who is listening, and that changes the voice. It got its own prompt and its own offline fallback.
Key decision three: ration the button before you ship it. The request line is an unauthenticated public endpoint that spends money and CPU on every press. It is capped twice — three per listener per hour, forty across the whole station per hour — using two hourly counters in DynamoDB that delete themselves via TTL. Rejection happens before anything is written, so a throttled caller costs one counter update and nothing else.

Challenges

The one that cost me the most time was silent and entirely my own fault. I added a  dedication_line  field to the prompt, deployed, requested a dedication for "everyone who shipped something this summer" — and got back a genuinely lovely piece that never mentioned the dedication at all. The model was returning the field correctly. My  _parse()  function is a whitelist that rebuilds a clean dict from known keys, and I had never added the new one, so it was being dropped between the model and the microphone. Two lines to fix, forty minutes to find. Whitelists fail quietly, which is exactly what makes them safe and exactly what makes them hard to debug.
The second was a deploy-time collision. My template hardcoded the EventBridge rule name as  nocturne-fm-on-air , so bringing up a second stack alongside the August one failed immediately. Deriving it from  ${AWS::StackName}  means both stations now run in the same account without fighting. Both are live right now on their own schedules.
The third is honest and unresolved: this account is under an account-level Bedrock restriction, so  bedrock:InvokeModel  returns  Error 002  no matter which Nova model I try. The Bedrock code path is written, deployed, and IAM-permitted;  LLM_PROVIDER  flips to it with no code change. Until then the writers' room runs on an external model, and if every provider is dark it falls through to a seeded offline writer — because an agent that throws at 3 a.m. is not an agent.

AWS services and architecture

EventBridge rate(2 hours) a listener, awake
│ │
│ POST /api/request
│ ┌─────────▼─────────┐
│ │ StationFunction │ 256 MB · 15s
│ │ the desk + line │
│ └─────────┬─────────┘
│ throttle (DynamoDB)
│ async invoke ─┐
└──────────────────►┌────────────────────────┐◄──────┘
│ BroadcastFunction │ 1769 MB · 300s
└────────────┬───────────┘
weather ─► script + score ─► Amazon Polly ─► pure-Python synth ─► mix
│
┌───────────────┴───────────────┐
▼ ▼
Amazon DynamoDB Amazon S3
(state, archive, requests, (public episode audio,
throttle counters + TTL) immutable)
  • AWS Lambda — two functions: a 1769 MB producer (memory buys CPU, and CPU is what keeps a dedication under a minute) and a small web tier.
  • Amazon EventBridge — the only thing that can trigger a scheduled broadcast.
  • Amazon DynamoDB — one table, four record types: station state, the episode archive, requests, and self-expiring throttle counters.
  • Amazon S3 — public, immutable episode audio, so links in this article still work in a month.
  • Amazon Polly — the presenter, on the generative engine, degrading SSML → plain → neural.
  • Amazon Comprehend — grades the sentiment of the station's own writing; the grade feeds tomorrow.
  • AWS Systems Manager Parameter Store — the model API key, as a SecureString.
  • AWS CloudFormation (SAM transform) — the whole station is one template. There are no third-party dependencies, so the deploy is a plain zip: no build step, no layer, no container.

What I learned across the summer

June/July — build the boring thing properly. My first AWS build this summer was ReceiptRadar, a receipt-scanning API. Unglamorous, but it is where I learned that IAM, atomic writes and TTL are not paperwork. Every one of those showed up again this weekend.
August — autonomy is a constraint, not a feature. Making Nocturne FM un-interruptible forced decisions I would have dodged with a play button. If nobody is watching, there is no one to retry for you, so the offline writer and the SSML fallback chain stopped being nice-to-haves.
This weekend — the hard part is deciding what not to let users touch. Adding the request line took an afternoon. Working out that it must not write station state, must not be able to jam the schedule, and must be rationed before it is written took most of the thinking. "Can a user trigger this?" turned out to be a much better question than "can I make this faster?"
And the flat one: comment your defensive code. The note I left myself in August explaining a race that could not yet happen is the reason this weekend's feature is not quietly corrupting the archive.

A builder who inspired me

 @Lewis Sawe  — The Museum That Grows, an always-on agent that curates a museum for a civilization that never existed. Reading it is what convinced me that an agent's archive is the artifact, not any single output. Nocturne FM's episode list owes that idea directly. The station cut a live dedication to them while I was testing this feature, which felt like the right way to say thanks.
And thank you to Ben Fowler and the AWS Builder Center team for running the Summer Build Series. Three weekends took me from "I have an AWS account" to something that has been broadcasting on its own for a week.
Go leave a word on the request line. It will read it back to you in about forty seconds. Live station:  https://5tf5wwlrfd3lu4cdsfpzalifxq0lulgl.lambda-url.us-east-1.on.aws/  Code:  https://github.com/umarahad2005/nocturne-fm-request-line 
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article