How to Run Codex Automations Outside Codex

70.2K views
•
September 16, 2026
by
Nate Herk | AI Automation
YouTube video player
How to Run Codex Automations Outside Codex

TL;DR

Build automations with Codex, convert them into code, store that code in GitHub, and run it through Trigger.dev to preserve your Codex subscription allowance. Use scheduled or webhook workflows for predictable processes, and reserve a Codex SDK agentic loop for routines that require genuinely unpredictable decisions.

Transcript

Codex lets you build automations right inside of it using scheduled tasks. However, because these scheduled tasks basically just send messages right into an actual chat thread. What that means is this eats at your actual weekly usage limit. So, it doesn't really make sense to build a bunch of your personal and company automations inside of codeex. ... Read More

Key Insights

  • Codex scheduled tasks consume subscription allowance because each scheduled execution effectively sends another message into an active chat thread. Recurring personal or company workflows can therefore reduce the weekly capacity available for interactive Codex work.
  • Trigger.dev can host automation code produced with Codex, allowing the resulting workflow to operate independently of a Codex chat. GitHub holds the code and connects the implementation to the service responsible for scheduled or event-triggered execution.
  • Three automation patterns are presented: scheduled workflows, webhook workflows, and Codex SDK workflows. Scheduled jobs run at a chosen cadence, webhooks respond to events such as form submissions, and SDK workflows support routines requiring a fuller agentic loop.
  • A morning brief automation can read calendar events, descriptions, times, attendees, and locations before deciding which meetings need preparation. It can perform public web research, draft a short briefing, and deliver the result through a ClickUp direct message.
  • Deterministic automation follows a predictable sequence that remains consistent across executions. The example always triggers, reads the calendar, evaluates research needs, drafts a message, and sends it, even though the content produced during individual AI steps varies.
  • Nondeterministic steps produce outputs that depend on changing inputs and AI reasoning. Research differs according to each calendar event, while the drafted briefing changes according to the research, making those steps variable within an otherwise predictable workflow.
  • Most business and personal productivity workflows described in the presentation are largely deterministic. Hosting the entire process inside a full Codex agentic loop is unnecessary when ordinary code can control the sequence and invoke AI only where judgment or flexible writing is required.
  • Trigger.dev's free plan can delay a scheduled 6 a.m. execution by up to an hour, according to the planning response shown. A paid plan may therefore be necessary when exact delivery time matters, while the free plan remains suitable for getting started.
  • More videos from this channel:
  • More from this channel: Nate Herk | AI Automation

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: How can I run Codex automations without using my weekly allowance?

Use Codex to plan the workflow and turn the automation into executable code, then place that code in GitHub and host its execution through Trigger.dev. Trigger.dev can run the workflow on a schedule or after an event, so repeated executions occur outside the Codex chat thread instead of continually consuming the subscription allowance.

Q: What accounts are needed to build an external Codex automation?

The demonstrated setup requires a Codex subscription, a Trigger.dev account, and a GitHub account. Codex helps plan and write the automation, GitHub stores and supplies the resulting code, and Trigger.dev hosts and executes it. Additional API keys or service access may also be required for connected tools such as Google Calendar or ClickUp.

Q: What is a scheduled automation in Trigger.dev?

A scheduled automation is code that Trigger.dev executes according to a defined timetable. It can run every 30 minutes, at 6 a.m. on Mondays, or on another chosen cadence. This resembles a scheduled task inside Codex, but the recurring execution happens through Trigger.dev instead of repeatedly sending messages into a Codex chat thread.

Q: How does the morning brief automation work?

The workflow starts at 6 a.m. on weekdays and reads events from the user's main work calendar, including descriptions, times, attendees, and locations. It evaluates which events need preparation, performs relevant public web research, uses AI to write a short briefing, and sends the finished message as a ClickUp direct message to the user.

Q: What is the difference between deterministic and nondeterministic automation?

A deterministic automation follows a predictable sequence in the same order each time, such as triggering, reading a calendar, researching, drafting, and sending. A nondeterministic step produces varying results based on its inputs and AI reasoning. The morning brief combines both: its overall workflow is fixed, while its research and drafted message change each day.

Q: When should a Codex SDK agentic loop be used?

A Codex SDK agentic loop makes sense when the overall routine is highly unpredictable and needs an agent to decide what actions to take as conditions change. Predictable business or personal productivity processes generally do not need the full loop. They can run as ordinary hosted code while using AI only for variable research, decisions, or writing.

Q: How can AI be used inside a deterministic workflow?

AI can handle selected steps without controlling the entire automation. In the morning brief example, ordinary code manages the schedule, calendar reading, and ClickUp delivery. AI evaluates whether events require research and drafts the final briefing. The sequence stays deterministic even though those AI-generated outputs vary according to calendar events and research results.

Q: Can Trigger.dev deliver a morning brief exactly at 6 a.m.?

The planning response shown states that Trigger.dev's current free-plan scheduling window can delay a 6 a.m. start by up to an hour. If exact timing is required, an upgrade may be necessary. If receiving the message at 6:05 or 6:10 is acceptable, the workflow can tolerate some delay while being tested and developed.

Summary & Key Takeaways

  • Codex scheduled tasks send messages into a chat thread, so recurring jobs consume the same weekly usage allowance as other Codex activity. The proposed alternative is to use Codex for planning and implementation, place the resulting code in GitHub, and let Trigger.dev execute it independently on a defined schedule or event.

  • The morning brief example runs at 6 a.m. on weekdays, reads events from a main work calendar, evaluates whether meetings need preparation, performs limited public web research, drafts a concise brief with AI, and sends the result as a ClickUp direct message. The initial research budget is capped at 25 cents.

  • The central design decision is whether a workflow is deterministic or nondeterministic. Fixed sequences such as triggering, reading a calendar, researching, drafting, and delivering are suitable for external hosting. Individual research and writing steps can still use AI, while a Codex SDK agentic loop is reserved for less predictable routines.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Nate Herk | AI Automation 📚