Missions

Missions are scheduled AI tasks. Set up a mission, assign it to an agent, and it runs automatically on your schedule.

Use missions for recurring work: daily reports, weekly SEO audits, content publishing, data monitoring, and more. Missions appear in the org sidebar and are global — not tied to a specific space.


Core Concepts

ConceptDescription
MissionA scheduled task with a goal, schedule, and assigned agent
GoalWhat the agent should accomplish (plain text instructions)
ScheduleWhen to run: once, cron, continuous, or manual
AgentOptional — runs the mission with this agent’s system prompt, model, and capabilities. The characterId field in the API refers to the agent ID
SpaceOptional — gives the mission access to files, MCPs, and secrets
maxTurnsLimits how many turns the agent can take per run (default: 100)
teamControls subagent delegation: auto, on, or off
resumeSessionEnables session continuity across multiple runs

Schedule Types

TypeDescriptionExample
noneManual trigger onlyRun on-demand
onceRun once immediatelyOne-time setup task
cronRecurring schedule0 9 * * MON (Mondays at 9am)
continuousRun continuouslyAlways-on monitoring

Cron Examples

Cron ExpressionDescription
0 9 * * *Every day at 9:00 AM
0 9 * * MONEvery Monday at 9:00 AM
0 9 * * 1-5Weekdays at 9:00 AM
0 */6 * * *Every 6 hours
0 9 1 * *First of every month at 9:00 AM

Execution Model

Missions run via a job queue powered by BullMQ with Redis:

  • 3 concurrent workers process missions in parallel
  • Automatic retry: 2 attempts with exponential backoff on failure
  • Stalled job detection: jobs that stop responding are recovered automatically
  • Status flow: pending -> running -> completed / failed

Mission results create chat entries visible in the space (if a space is assigned).


Create a Mission

Via Web App

  1. Navigate to the Missions section in the sidebar
  2. Click + New Mission
  3. Configure:
    • Title: “Weekly SEO Report”
    • Goal: “Analyze this week’s search performance. Compare to last week. Send the summary.”
    • Schedule: Cron — 0 9 * * MON
    • Agent: Select “Sarah” (optional)
    • Space: Select your SEO workspace (optional)
    • Max Turns: 100 (optional)
    • Team: auto (optional — controls subagent delegation)
  4. Save

Via CLI

teamday missions create \
  --title "Weekly SEO Report" \
  --goal "Analyze this week's search performance, compare to last week, and summarize the findings." \
  --schedule cron --cron "0 9 * * MON" \
  --agent <agent-id> \
  --space <space-id>

Via API

curl -X POST "https://cc.teamday.ai/api/v1/missions" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Weekly SEO Report",
    "goal": "Analyze this week search performance, compare to last week, and summarize the findings.",
    "spaceId": "space-abc123",
    "characterId": "agent-sarah-id",
    "schedule": {
      "type": "cron",
      "value": "0 9 * * MON"
    },
    "maxTurns": 100,
    "team": "auto"
  }'

Note: The characterId field is the agent’s ID. This field name is preserved for API compatibility.

Response:

{
  "success": true,
  "id": "mission-xyz789",
  "title": "Weekly SEO Report",
  "status": "pending",
  "schedule": {
    "type": "cron",
    "value": "0 9 * * MON",
    "nextRun": "2026-02-24T09:00:00.000Z",
    "runCount": 0
  }
}

Mission Examples

Daily Data Summary

{
  "title": "Daily Analytics Summary",
  "goal": "Pull yesterday's Google Analytics data. Report: total visitors, top 5 pages, bounce rate change. Save to reports/daily/.",
  "schedule": { "type": "cron", "value": "0 8 * * *" },
  "maxTurns": 50
}

Weekly Content Audit

{
  "title": "Weekly Content Audit",
  "goal": "Check all blog posts published this week for SEO compliance. Verify: meta descriptions, image alt text, internal links. Report any issues.",
  "schedule": { "type": "cron", "value": "0 17 * * FRI" },
  "team": "on"
}

Continuous Monitoring

{
  "title": "Error Monitor",
  "goal": "Monitor the application for critical errors. If error rate exceeds 5%, send an alert notification.",
  "schedule": { "type": "continuous" }
}

One-Time Setup

{
  "title": "Initial SEO Baseline",
  "goal": "Run a comprehensive SEO audit of example.com. Document current rankings, backlinks, and technical issues. Save the baseline report to reports/.",
  "schedule": { "type": "once" }
}

Managing Missions

Update a Mission

Pause, change the schedule, or update the goal:

curl -X PATCH "https://cc.teamday.ai/api/v1/missions/mission-xyz789" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "paused",
    "schedule": { "type": "cron", "value": "0 9 * * 1-5" }
  }'

Mission Statuses

StatusDescription
pendingCreated, waiting for first scheduled run
runningCurrently executing
completedFinished successfully (one-time missions)
failedExecution failed (will retry if attempts remain)
pausedTemporarily stopped by user

Session Continuity

Missions support session continuity via the resumeSession flag. When enabled, each run resumes from the previous session’s context using the stored lastSessionId, maintaining conversation history across runs.

This is useful for missions that build on previous results — like weekly reports that compare to last week, or monitoring tasks that track changes over time.


Agents and Missions

Binding an agent to a mission means:

  • The mission runs with the agent’s system prompt (systemPrompt)
  • It uses the agent’s model preference
  • It has access to the agent’s skills and MCP references

If no agent is bound, the mission runs with default settings.

Best Practice

Create dedicated agents for mission types:

teamday agents create \
  --name "Report Bot" \
  --role "Automated Reporting" \
  --category data \
  --system-prompt "You generate daily and weekly reports. Be concise. Use tables. Save reports to the reports/ directory with dated filenames."

Then bind it to multiple missions:

{"title": "Daily Sales Report", "characterId": "report-bot-id", "schedule": {"type": "cron", "value": "0 8 * * *"}}
{"title": "Weekly Performance Review", "characterId": "report-bot-id", "schedule": {"type": "cron", "value": "0 9 * * MON"}}

Note: characterId in the API refers to the agent’s ID.


Writing Good Mission Goals

The goal field is the instruction the agent receives. Write it like you’d brief a human colleague:

Vague (bad):

Check the website.

Specific (good):

Check example.com for broken links, missing meta descriptions, and pages with no H1 tag.
Save the results to reports/site-audit-{date}.md.
If critical issues are found, create a summary at the top.

Key tips:

  • State the objective clearly
  • Specify output format and location
  • Include thresholds or criteria when relevant
  • Mention what to do with the results

Next Steps