What a routine is
A routine is a scheduled agent run on your side: Claude Code, Codex or Cursor wakes up on a timer you set, opens the Lavendly MCP server and makes a video. Lavendly does the making and the posting (generate, render, publish to your channel). The schedule itself lives in your agent, not in Lavendly. Lavendly schedules posts (schedule_video), never agent runs.
Your template is a film you already like
Make one film by hand, in the Studio or with your agent, until you are happy with it. That film is the template. It holds everything that should stay the same: the look, the music, the structure, the scenes that never change (an intro, a product shot, a sign-off). Each run copies the template and changes only two things: the subject and the hook. Today it is cold brew, tomorrow matcha, the day after oat milk. Same channel, same feel, a new video every day. Two rules make this cheap and safe:- A scene that already has a clip is reused and never charged. Only the scenes you change get generated, so a run usually costs one or two clips.
- The template is never edited by the run. The run makes a new film from a copy, so tomorrow starts from the same template.
Example: a daily coffee short
A 3-scene vertical short for a coffee channel. Scene 1 is a hook about the day’s drink (generated), scene 2 is the same pour shot every day (reused), scene 3 is the brand sign-off (reused). One music track runs across the film.1. Set up once
Find the two ids the routine needs, by asking your agent once:- the template film:
list_workflows, then note theidof “Coffee daily (template)” - the channel:
list_channels, then note theidof your TikTok channel
npx server.
2. Give Claude Code the schedule
Run/schedule in Claude Code (or create a routine on the Routines page of
Claude Code on the web), with the Lavendly connector attached, and paste:
3. What the run does
Budget
estimate_costfirst, every run. The routine stops before spending if the price is over your cap or your balance is short.max_creditson every spending call. The server holds the cap, so a confused run cannot spend more than you approved.idempotency_keywith the date. A retried step replays the first answer, so a hiccup never makes two films, charges twice or posts twice.- Watch the month.
get_ledgerandget_monthly_usageshow what the routine has spent; your plan’s monthly cap still applies.
estimate_cost on your own template.
Post now or later
publish_video posts as soon as the film is ready. To post at your channel’s
best hour instead, use schedule_video with a when in the future: the run
makes the film at 09:00 and Lavendly posts it at 18:00. Review queued posts with
list_scheduled_posts and stop one with cancel_scheduled_post.
To review before anything goes out, leave step 8 out and the run ends with the
finished film in your project.
Example: a weekly roundup
A Monday recap built from the week’s films. Nothing new is generated, so it costs nothing but the render, which is free.Other agents
- Codex: run
codex exec "<the routine prompt>"from cron or a scheduled CI job, with Lavendly in~/.codex/config.toml. - Cursor: run
cursor-agent -p "<the routine prompt>"from cron or a scheduled CI job, with Lavendly in~/.cursor/mcp.json.