How to Create a Workflow
A workflow is just a plain text file with step-by-step instructions. You write it in plain English, save it as a .md file in your global_workflowsfolder, and the agent follows it. That's it. There is no code, no special syntax, and no programming required.
The easiest way: just tell the agent
You do not have to write workflows by hand. You can simply describe what you want to Antigravity in the chat:
The agent will write the workflow file, create any necessary skill files, save everything to the correct directories, and tell you the slash command to run it. You can then run it, see how it performs, and ask the agent to refine it based on what you observe. This can be as detailed as you want — give it every single step, and it will structure them into a proper workflow.
Or write the text file yourself
If you prefer to write the workflow manually, it's just as straightforward. Think of it like writing instructions for a very capable assistant who will follow them to the letter. You tell it:
- What to do, step by step
- What tools to use (web search, browser, file system, etc.)
- What files to create and where to save them
- What quality standards to meet before moving on
- When to stop and ask you vs. when to keep going on its own
The agent reads the entire workflow, then executes each step in order. If a step says "search the web for X," it searches. If a step says "write a memo and save it as report.md," it writes the memo and saves the file. If a step says "review your own work and fix any errors," it does that too.
- Open any text editor (such as Notepad, VS Code, or Antigravity's built-in editor).
- Write your steps in plain English. Be specific about what you want the agent to do, what files to create, and what quality bar to hit.
- Save the file as a
.mdfile in yourglobal_workflowsfolder (e.g.,my_workflow.md). - Open Antigravity and type
/my_workflowin the chat to run it.
What are skill files?
A skill file is a subroutine — a set of detailed instructions for a specific sub-task that the agent runs when it's processing a particular step of a workflow. Instead of cluttering the main workflow with a page of instructions for one step, you put those instructions in a skill file and the workflow just says "read and apply the skill file."
For example, the Legal Analysis workflow has a skill file called legal_analysis_partnerthat contains detailed instructions for how the "Partner" agent should review a memo — what to look for, how harsh to be, what format to use for feedback, and so on.
And those skill files can have their own subroutines — so this can get as complicated as you want.
Skill files live in your skills/ directory, in a subfolder named after the skill:
.gemini/
└── antigravity/
└── skills/
└── legal_analysis_partner/
└── SKILL.mdYou do not need skill files for simple workflows — they are only useful when a sub-task has complex instructions that you want to reuse across multiple workflows.
A real-world example: document review
Say you're a lawyer. Your client is a professional clown who is suing The Atlantic magazine for defamation. They published an article claiming he was involved in some scandal, and it's not true. You have 100,000 pages of documents as evidence — emails, contracts, text messages, photos, PDFs, scanned handwritten notes, you name it. You need to figure out which of those 100,000 documents actually help your case.
To win, you need to prove four things — and you also need to watch for the defenses The Atlantic will throw at you:
Your claims:
- The Atlantic published a statement about your client
- The statement was false
- The Atlantic knew it was false (or didn't bother to check)
- Your client suffered actual harm because of it
Their likely defenses:
- The statement was substantially true
- The statement was protected opinion, not a factual claim
- Your client is a public figure and can't prove "actual malice"
Normally, you'd assign a team of associates to read every single document and tag the relevant ones. That takes months and costs a fortune. Here's how you'd do it with Antigravity instead.
Step 1: Tell Antigravity what you need
You open Antigravity and just explain the situation in plain English. Something like:
My claims:
1. The Atlantic published a statement about my client
2. The statement was false
3. The Atlantic knew it was false or didn't bother to check
4. My client suffered actual harm because of it
Their likely defenses:
1. The statement was substantially true
2. The statement was protected opinion
3. My client is a public figure (actual malice standard)
For each document, give me a score from 1 to 6 for each of those seven items. 1 means irrelevant, 6 means smoking gun. Also summarize each document — what it is, who wrote it, what it says, and how it's relevant to each issue. Store everything in a database so I can search and sort later. Process the documents one at a time so you don't rush through them. And write up a workflow for this so I can run it again.
That is the entire prompt. Antigravity will take that conversational request, translate it into a structured workflow file with step-by-step instructions, and automatically save it in your global workflows folder.
Step 2: Test it on a small batch
Before running it on all 100,000 documents, you tell Antigravity to run the workflow on just 100 documents first. It processes them one at a time — reading or scanning (via OCR) each document, summarizing what it contains and who wrote it, and scoring it on a 1-6 scale for each of the seven items (four claims plus three defenses). It stores everything in a database.
You look at the output. Perhaps the grading criteria for "actual harm" are too loose — it's giving 4s to documents that are really just 2s. So you tell Antigravity: "Tighten up the scoring for element 4. A document should only score above a 3 if it shows a specific, quantifiable loss — like a cancelled contract or a lost booking."
Antigravity updates the workflow. You run it on another 100 documents. This time the scores look right.
Step 3: Run the full batch overnight
Now you run the workflow on all 100,000 documents. You go to sleep. Antigravity works through the night, processing each document one at a time, summarizing it, grading it on all seven items, and logging everything to the database. When you wake up in the morning, it's done.
Step 4: Build the case
With the database complete, you tell Antigravity:
A few minutes later, you have a complete chronology and a case-building roadmap — sourced from 100,000 documents — sitting on your desktop.
What just happened
The workflow that Antigravity created and ran was a plain English text file. It told the agent to create a database, read documents one at a time, grade each one, store the results, and generate reports. Skill files handled the details — how to OCR an image, how to assess probative value, how to handle different document types (email threads vs. contracts vs. handwritten notes). Those skill files had their own sub-skills. The whole system was just nested layers of plain English instructions.
The lawyer didn't write a single line of code. They just described what they needed, tested it on small batches, refined the instructions based on what they saw, and then let it run.
Want to see the actual workflow? The full, production-grade version of this document review workflow — with database schemas, calibration phases, quality audits, and case strategy generation — is available as a sample workflow on this site. That workflow was literally created by talking to Antigravity for a few minutes, giving it the same information described above. It wrote the entire thing.
Techniques used in the workflows on this site
The sample workflows on this website use several techniques you can adopt in your own workflows:
Multi-agent review
From the Legal Analysis workflow — one agent writes, another audits, then the first agent revises. You are simply telling it to write something, then telling it to criticize what it just wrote, then telling it to fix the problems.
Adversarial analysis
From the Credibility Check workflow — the agent argues the strongest possible case that a claim is true, then argues the strongest possible case that it's false, then acts as a neutral judge to render a verdict.
Monte Carlo simulations
From the Predict Future workflow — the agent creates 1,000 identical starting "worlds," runs them forward, and categorizes the outcomes into probability buckets. You just have to ask for it and specify the output format.
Strict formatting rules
From the Fact Check workflow — every citation must include the author, title, publication, date, full URL in plaintext, and an exact verbatim quote. The more specific your formatting rules, the more consistent the output.
Engine switching
From the Predict Future workflow — different AI engines (Claude, Gemini, etc.) have different strengths. You can tell the workflow to switch engines mid-process and the agent handles the handover automatically.