Host Anti-Gravity Agentic Workflows in the Cloud (for FREE)
By Jono Catliff
Uploading Anti-Gravity Workflows to Modal for Free
Key Concepts:
- Anti-Gravity: A no-code platform for building agentic workflows.
- Agentic Workflow: An automated process where AI agents autonomously complete tasks.
- Modal: A serverless platform for running Python code in the cloud.
- Webhook: A URL that receives data when an event occurs in another application.
- Scheduler: A function that triggers a workflow at predetermined intervals.
- API Token: A unique identifier used to authenticate access to an API.
- HTTP Request: A method for communicating between clients and servers on the internet.
- Markdown (MD): A lightweight markup language with plain text formatting.
- Timeout: A period of inactivity after which a connection or process is terminated.
Introduction: The Problem with Local Workflows
The video addresses the limitations of running Anti-Gravity workflows solely on a local computer. The primary issue is reliability: if the internet connection is lost or the computer fails, the workflows become inoperable. This is particularly problematic for mission-critical workflows that require continuous operation and potential team access. The solution presented is hosting these workflows in the cloud using Modal, a platform offering $5 in free credits.
Setting Up Modal and Connecting to Anti-Gravity
The process begins with signing up for a Modal account using a Google email address. While Modal offers a configuration setup, the presenter recommends using a provided script (available in the video description) to avoid common errors encountered during initial setup.
Step-by-Step Process:
- Create a New Anti-Gravity Project: A new project is created within Anti-Gravity, starting with a blank slate.
- Create an Instructions File: A file named
instructions.md(Markdown format) is created and populated with the provided script. This script contains instructions for Anti-Gravity to establish the Modal connection. The presenter notes understanding the script isn’t necessary, it simply facilitates the connection. - Initial Prompt & Task Acceptance: A prompt is sent to Anti-Gravity with two requirements: creating a simple agentic workflow and establishing the Modal connection. Anti-Gravity analyzes the instructions and presents a series of tasks for approval ("giving the green light").
- API Token Creation: The crucial step involves creating an API token to authorize the connection between Anti-Gravity and Modal. This is done through a Modal authorization process.
- Troubleshooting & URL Retrieval: If the initial connection fails (e.g., opening a new browser window unexpectedly), a follow-up prompt is sent to Anti-Gravity requesting the workflow URL without opening a new browser.
- Webhook Retrieval: Once the connection is established, Anti-Gravity generates a webhook URL for the workflow.
Testing the Workflow with a Simple Agent
The presenter demonstrates the functionality with a basic agentic workflow: receiving a user's name and responding with "Hey," followed by the user's first name. The webhook URL is tested using Naden (a tool for testing HTTP requests) and a direct browser request. Both methods successfully return the expected response ("Hey Jonno" when the name "Jonno" is provided), confirming the workflow is operational. The workflow is also visible running within the Modal interface.
Implementing a Scheduled Trigger
The video then demonstrates how to change the workflow trigger from an HTTP request to a scheduler.
Step-by-Step Process:
- Restructure the Workflow: A prompt is sent to Anti-Gravity requesting a change to a schedule trigger, set to execute every 10 seconds.
- Provide a Webhook Destination: A URL within Naden is provided as the destination for the scheduled workflow's output.
- Align HTTP Method: The HTTP method in Naden is set to "POST" to match the expected method from the scheduled workflow.
- Verification: The presenter verifies the scheduled workflow is functioning by observing real-time data arriving in Naden every 10 seconds ("Hey Jonel, sent at…").
Local vs. Cloud Hosting: Pros and Cons
The video concludes with a comparison of hosting Anti-Gravity workflows locally versus in the cloud.
Local Hosting:
- Pros: Free to use, instant execution.
- Cons: Reliant on computer uptime and internet connectivity, unsuitable for mission-critical operations. No timeouts. No authentication needed.
Cloud Hosting (Modal):
- Pros: Reliable, accessible anywhere, supports team collaboration, pay-per-use (cheap with initial credits).
- Cons: Server spin-up time (slower initial execution), potential for timeouts (addressed by using a two-workflow approach – initial call followed by webhook data reception), requires authentication to secure publicly available webhooks and prevent unauthorized API usage and potential billing issues.
Quote: "If your computer dies or the internet cuts and so on and so forth, you're not going to be able to run mission critical business operations." - Presenter, highlighting the core problem solved by cloud hosting.
Conclusion
The video effectively demonstrates a straightforward method for deploying Anti-Gravity workflows to Modal for free, enhancing their reliability and accessibility. The comparison of local and cloud hosting provides a clear understanding of the trade-offs involved, enabling users to make informed decisions based on their specific needs. The emphasis on securing webhooks with authentication is a crucial takeaway for preventing potential security and financial risks. The provided script and detailed step-by-step instructions make the process easily replicable for viewers.
Chat with this Video
AI-PoweredHi! I can answer questions about this video "Host Anti-Gravity Agentic Workflows in the Cloud (for FREE)". What would you like to know?