Automation and Integration
Agents
An agent is an app with an agent: block. Same entity, same deploy path, same console.
Create an agent
grid init agent daily-report --type node
Define agent behavior
name: daily-report
services:
worker:
type: node
path: /
requires:
- db
- ai
agent:
purpose: "Generate and email daily sales reports"
schedule: "0 8 * * *" # Every day at 8 AM
The agent block supports:
purpose— What the agent does (plain text)schedule— Cron expression for when it runs
Agent with memory and budget
agent:
purpose: "Triage incoming support tickets"
schedule: "*/15 * * * *" # Every 15 minutes
memory:
collection: triage_history
retention: 90d
budget:
tokens_per_month: 100000
hard_stop: true # Stop when budget is exhausted
Cron services (scheduled jobs)
For simpler scheduled work without the full agent model, use a cron service:
services:
cleanup:
type: cron
schedule: "0 3 * * *" # Daily at 3 AM
run: job # Default: runs src/job.js or src/main.py
timezone: UTC
For HTTP-triggered cron (no code in your repo):
services:
ping:
type: cron
schedule: "*/5 * * * *"
run: "https://my-api.your-org.cloudgrid.io/cron/ping"