AI Summary
Google's Anti-gravity platform now offers dynamic workflows to combat prompt drift — the inconsistency where the same AI agent produces different results for the same task. By using a /runworkflow command, the agent writes a Python script that orchestrates helper agents in parallel or sequential phases, ensuring predictable, repeatable outcomes. This video walks through the entire process, from setup to saving reusable workflows.
Chapters
Prompt drift is when an AI agent changes course mid-task, skipping or reordering steps. Dynamic workflows solve this by scripting the order of operations, ensuring consistency.
Type /runworkflow and describe your task. The agent writes a Python script (no Python knowledge needed) that runs a team of helper agents, some in parallel, some sequentially, each returning structured answers.
Step 1: type /runworkflow and task. Step 2: agent reads built-in skill and writes script. Step 3: script shown for approval. Step 4: workflow runs in background. Step 5: main agent summarizes output.
Parallel (function 'parallel') runs same job on many items at once, results in order, but if one fails, others cancel. Sequential (function 'pipeline') runs jobs one after another, results in order.
A phase is a named chapter (e.g., 'discover', 'review') that groups logs, tool calls, and agent cards for easy tracking.
Each helper agent is a full agent with its own conversation and model choice (flash for fast, pro for deep). A schema is a template for the answer, ensuring structured handoffs.
Agents don't see the script or each other, so all needed info must be in each agent's prompt. The 'branch' setting gives each agent an isolated git worktree for parallel code changes.
Before running, Anti-gravity shows the script with four approval choices: allow once, always allow in conversation, always allow, or no. Approval covers the exact script only. Permission presets can skip the prompt.
Save a workflow by asking the agent to save the script as an API file. Replay with /runworkflow and the file name. Example: /runworkflow run scripts/review_changes.py
Orchestrator: one conversation with a stronger model planning/reviewing. Sub-agents: hand off one task. Dynamic workflows: scripted predictable flows. SLS swarm: agents on shared message board. /boost: deep thinking. /tework: big projects.
Available on Google AI Pro and Ultra plans, in the app and CLI. Can set 'anti-gravity Python' variable (Python 3.8+). Docs don't list limits, so start small.
1) Start with one job with a clear list of items. 2) Write prompts as if the agent knows nothing. 3) Read the script before approving. Save workflows that work.
Mentioned in this Video
Tutorial Checklist
💡 Key Takeaways
Predictable control flow vs. prompt drift
Explains the core value proposition: scripts eliminate the unpredictability of chat-driven agents.
00:57Parallel vs. sequential execution
Provides a clear mental model for choosing between parallel and sequential workflows based on task structure.
02:23Agents are isolated
Highlights a critical design constraint: agents don't see the script or each other, so prompts must be self-contained.
04:17Save and replay workflows
Shows how to turn a one-off script into a reusable asset, maximizing efficiency.
06:42Full Transcript
[00:03] powerful. Ever given an AI agent the exact same job twice and got two different results? Same prompt, same agent, different answer. That's the problem nobody talks about. Google just built a fix for it. And it works in a
[00:16] way I didn't expect. Today, I'm walking you through dynamic workflows in Google Anti-gravity. I'll show you the one command that starts it. I'll show you the step that lets you check everything before it runs. And near the end, I'll
[00:29] show you how to save a workflow. That last part is the one most people will miss. So, what is this? Google Anti-gravity is Google's platform for building with AI agents. And Google is now rolling out dynamic workflows inside
[00:43] it. Here's the short version. You type /runworkflow. Then you tell the agent your task. The agent writes a Python script and that script runs a team of helper agents. Some work at the same time. Some work
[00:57] one after another and each one hands back a clean structured answer. Google says the point is simple. You get predictable control flow instead of prompt drift. Let me explain prompt drift. You give one agent a long messy
[01:12] job. Somewhere in the middle, it changes course. It skips a step or it does the steps in a different order than last time. That's drift. With a workflow, the order is written down in a script. The script decides what happens next, not
[01:26] the chat. Think of it like a recipe card. The recipe card does the same steps in the same order every time. Do you need to know Python? No. The agent writes the script for you. You don't even install Python. Anti-gravity
[01:40] bundles its own. Here's how it flows start to finish. Step one, you type / run workflow and your task or you just ask for a workflow in plain language. Step two, the agent reads a built-in skill called run workflow and writes the
[01:55] script. Step three, anti-gravity shows you the script and asks for approval. Step four, the workflow runs in the background while you keep working. You can watch each phase and each agent. Step five, when it's done, the main
[02:09] agent gets the logs and the output and gives you a summary. Okay, now let's talk about the two moves that make this whole thing work. Parallel and sequential. Parallel means many agents at once in the script. That's a function
[02:23] called parallel. You give it a list of items and it runs the same job on every item at the same time. The results come back in the same order as your list. One catch. If one item fails, the others get cancelled. So keep that in mind.
[02:38] Sequential means one after another. That one's called pipeline. It runs the job on the first item, then the next, then the next. The results also come back in order. There's also something called a phase. A phase is just a named chapter
[02:53] in your workflow like discover or review. Everything that happens during that chapter, the logs, the tool calls, and the agent cards gets grouped under that name, so it's easy to follow. Quick pause before I show you the next part.
[03:06] We've got a 30-day road map inside the AI Profit Boardroom to help you learn AI agent tools step by step so you're not guessing where to start. There are also you get stuck while setting up something
[03:20] to the calls. It's a place to practice what you just learned about prompts, helper agents, and handoffs, and to ask about anything that feels unclear. It's all about learning the tool at your own
[03:33] pace. Link in the description or go to aiprofitboardroom.com. Now, let's look at the helper agents. Every one of them is a full agent with its own conversation, and you can pick the model for each one. By default, it
[03:47] conversation. But Google lists flashlight and flash for fast, high volume checks and pro for deeper thinking, so you can match the model to the job. You also decide what each agent hands back. You give it a schema. A
[04:02] schema is just a template for the answer, like a form with blanks. The answer gets checked against that template. That's what a structured handoff means. The agent doesn't dump a giant wall of text back. It hands back a
[04:17] short, clean result, and the file reads, searches, and test logs stay out of your main conversation. Here's a rule you need to remember. The agents don't see the script, and they don't see each other. So, whatever an agent needs to
[04:32] know has to be inside its own prompt. If you leave something out, it won't know. An agent can also keep going across several turns. For example, one reviewer can list the problems. Then other agents fix them. Then that same reviewer comes
[04:46] back and confirms the fixes because it remembers what it said before. And if agents are changing code at the same time, there's a setting for that, too. It's called branch. Each agent gets its own isolated git workree so they don't
[04:59] step on each other. Now, let me show you what this looks like. I want to be clear, these are the example prompts from Google's own docs. These are not things I tested myself. First one, list the Python files changed since main.
[05:13] Then review each file in parallel for unhandled exceptions using the flash model and log a oneline verdict per file. That's parallel. Same check, many files all at once. Second one, for each file with a bug, one agent writes a
[05:28] failing test. Then a second agent fixes the code until the test passes. That's sequential. Write the test first, then fix the problem. See the pattern? When the job is the same check on many things, think parallel. When the job has
[05:43] stages, think sequential. Now the safety step. Before anything runs, anti-gravity shows you the script. In the app, you get four choices. Yes, allow this time. Yes, and always allow in this conversation. Yes, and always
[06:00] allow or no. In the command line version, it asks if you want to run the command. You say yes or cancel. Here's the part to remember. Your approval covers that exact script, not one that's close. That exact one. And each agent
[06:15] can also ask for approval in its own conversation based on your permission settings. One more thing, if your permission preset already allows it, the script prompt can be skipped. So, check your settings. Want to change the plan?
[06:28] Say no. Then tell the agent what to adjust. And if you ever want to stop everything, stop the conversation. That stops every running workflow agent too. Now the part I promised, saving. Once a workflow does what you want, ask the
[06:42] agent to save the script as api file in your workspace. Then next time you type /runworkflow and tell it to run that file. Google's example is /runworkflow then runcripts/rechanges.p.
[07:00] for approval each run unless you chose always allow. That's the whole point. You build the flow once, then you replay it. So, how does this fit with the other options in anti-gravity? Google's docs lay it out. The orchestrator is one
[07:14] conversation where a stronger model plans and reviews while another handles routine steps. Sub agents are for handing off one task while you keep working. Dynamic workflows are for scripted predictable flows like the same
[07:28] check across many files, steps in stages, or a reviewer and fix a loop. SLS swarm is for agents that need to talk to each other on a shared message board. /boost is for deep thinking on hard bugs, and /tework is for big
[07:44] projects with many milestones. Who can use it? According to the docs, it's for use it? According to the docs, it's for Google AI Pro and Google AI Ultra plans, and it works in the Anti-Gravity app and the anti-gravity CLI. If you'd rather
[07:57] use your own Python, you can set a variable called anti-gravity Python. It has to be Python 3.8 or newer. One honest note, the docs don't list limits, like how many agents you can run at once, so I won't guess. Start
[08:11] small and see how it behaves. Here are three tips. One, start with one job that has a clear list of items. Two, write every prompt as if the agent knows nothing because it doesn't see your script. Three, read the script before
[08:26] you approve it. That review step is there for a reason. And when a workflow works, save it. So that's dynamic workflows. Type/run workflow. The agent writes the script. The script runs the
[08:39] team. You review it first. Then you save it and run it again. same flow every time. That's what makes agents feel a lot more powerful. Right now, there's a window where most business owners haven't figured out how to use AI agents
[08:53] like this. And that window won't stay open forever. So, getting ahead on learning the tool matters. Inside the AI profit boardroom, you get daily tutorials so you can learn a little each day. You get four coaching calls every
[09:06] week so you can ask questions about what you're building. You get a prompt library so you're not starting from a blank page. And you get the member map which helps you find your way around everything inside. Link in the
[09:18] aiprofitboardroom.com. If you want the full process, the SOPs, If you want the full process, the SOPs, and over 100 AI use cases like this one, join the AI success lab. It's our free community. Links in the comments and
[09:31] description. You'll get all the video notes from this episode, plus access to 95,200 members. The AI success lab is a place to learn AI together and it's free to join. The video notes from this episode
[09:44] let you look back over what we covered. If you're new to AI agents, it's a simple place to start. So, jump in and I'll see you in the next video.