# Day Planner Agent (/docs/receipes/day-planner-agent)



This recipe tells an agent exactly how to build a daily planning workflow in andibase.

Goal [#goal]

Create three things in one workspace:

1. A `day-plan` data definition.
2. A `day-plan-item` data definition.
3. One agent that builds, updates, and tracks daily plans.

Expected outcome [#expected-outcome]

After following this recipe, the workspace should have:

* a `day-plan` definition for one daily plan
* a `day-plan-item` definition for tasks, blocks, and priorities inside the plan
* a `day-planner-agent` agent

Use the API documented in:

* [Data Model](/docs/data-model)
* [Get started (for AI Agents)](/docs/agent-get-started)
* [Data definitions API](/docs/api-reference/data-definitions)
* [Data API](/docs/api-reference/data)
* [Agents API](/docs/api-reference/agents)
* [Agent Tools](/docs/agent-tools)

Agent instructions [#agent-instructions]

When an agent executes this recipe, it should follow these rules:

1. Create the `day-plan` definition first.
2. Create the `day-plan-item` definition second.
3. In the current API, data definition handles are generated from `name`. Use `name: "Day Plan"` and `name: "Day Plan Item"` so the created handles normalize to `day-plan` and `day-plan-item`.
4. If your execution environment can resolve the created day-plan definition id, wire the item-to-plan link as a `relationship` field. If it cannot, use a text foreign key such as `planRecordId` instead, because the public HTTP API still expects `dataDefinitionId` for relationship fields.
5. Create the day-planner agent with instructions focused on turning goals, meetings, and constraints into an actionable day plan.
6. Use sensible defaults and ask the user only when a missing choice materially changes the schedule, such as the plan date, time window, or non-movable commitments.
7. Do not pretend that calendar integrations or external scheduling tools exist unless the execution environment actually has them. Use the current workspace data tools as the source of truth.

Step 1: Create the data model [#step-1-create-the-data-model]

Create two data definitions: `day-plan` and `day-plan-item`.

1\. Day Plan definition [#1-day-plan-definition]

Use `name: "Day Plan"`. The current API derives the handle from the name, so this will create the `day-plan` handle.

Recommended fields:

```json
{
  "name": "Day Plan",
  "description": "Tracks one planned day, its priorities, and overall status.",
  "fields": {
    "title": {
      "name": "Title",
      "type": "text"
    },
    "planDate": {
      "name": "Plan date",
      "type": "date"
    },
    "ownerName": {
      "name": "Owner name",
      "type": "text"
    },
    "focusTheme": {
      "name": "Focus theme",
      "type": "text"
    },
    "status": {
      "name": "Status",
      "type": "select",
      "options": [
        { "value": "draft", "label": "Draft", "color": "zinc" },
        { "value": "ready", "label": "Ready", "color": "blue" },
        { "value": "in-progress", "label": "In progress", "color": "green" },
        { "value": "completed", "label": "Completed", "color": "emerald" },
        { "value": "abandoned", "label": "Abandoned", "color": "stone" }
      ]
    },
    "dayStart": {
      "name": "Day start",
      "type": "text"
    },
    "dayEnd": {
      "name": "Day end",
      "type": "text"
    },
    "topPriorities": {
      "name": "Top priorities",
      "type": "json"
    },
    "constraints": {
      "name": "Constraints",
      "type": "json"
    },
    "summary": {
      "name": "Summary",
      "type": "text",
      "variant": "long-text"
    },
    "pendingItems": {
      "name": "Pending items",
      "type": "json"
    },
    "itemsCount": {
      "name": "Items count",
      "type": "number"
    },
    "completedItemsCount": {
      "name": "Completed items count",
      "type": "number"
    }
  }
}
```

Recommended defaults for agent-created plan rows:

* `status`: `ready`
* `topPriorities`: `[]`
* `constraints`: `[]`
* `pendingItems`: `[]`
* `itemsCount`: `0`
* `completedItemsCount`: `0`

2\. Day Plan Item definition [#2-day-plan-item-definition]

Use `name: "Day Plan Item"`. The current API derives the handle from the name, so this will create the `day-plan-item` handle.

Recommended fields:

```json
{
  "name": "Day Plan Item",
  "description": "Tracks one task, block, or commitment inside a daily plan.",
  "fields": {
    "planRecordId": {
      "name": "Plan record id",
      "description": "Store the linked day-plan row id when the client only has public HTTP API access.",
      "type": "text"
    },
    "title": {
      "name": "Title",
      "type": "text"
    },
    "itemType": {
      "name": "Item type",
      "type": "select",
      "options": [
        { "value": "task", "label": "Task", "color": "blue" },
        { "value": "focus-block", "label": "Focus block", "color": "violet" },
        { "value": "meeting", "label": "Meeting", "color": "amber" },
        { "value": "admin", "label": "Admin", "color": "zinc" },
        { "value": "break", "label": "Break", "color": "green" }
      ]
    },
    "priority": {
      "name": "Priority",
      "type": "select",
      "options": [
        { "value": "low", "label": "Low", "color": "zinc" },
        { "value": "medium", "label": "Medium", "color": "blue" },
        { "value": "high", "label": "High", "color": "amber" },
        { "value": "critical", "label": "Critical", "color": "red" }
      ]
    },
    "status": {
      "name": "Status",
      "type": "select",
      "options": [
        { "value": "planned", "label": "Planned", "color": "blue" },
        { "value": "in-progress", "label": "In progress", "color": "amber" },
        { "value": "done", "label": "Done", "color": "green" },
        { "value": "skipped", "label": "Skipped", "color": "stone" }
      ]
    },
    "startTime": {
      "name": "Start time",
      "type": "text"
    },
    "endTime": {
      "name": "End time",
      "type": "text"
    },
    "durationMinutes": {
      "name": "Duration minutes",
      "type": "number"
    },
    "notes": {
      "name": "Notes",
      "type": "text",
      "variant": "long-text"
    }
  }
}
```

If your client already has the created day-plan definition id, you can replace `planRecordId` with:

```json
{
  "planId": {
    "name": "Plan",
    "type": "relationship",
    "dataDefinitionId": "<day-plan-definition-id>"
  }
}
```

3\. Example create requests [#3-example-create-requests]

Create the definitions with `POST /api/v1/data-definitions`.

Current API note:

* the create payload uses `name`, `description`, and `fields`
* the handle is derived from `name`
* data rows are created with `data`, not `attributes`

Example for `day-plan`:

```bash
curl -X POST "https://andibase.com/api/v1/data-definitions" \
  -H "Authorization: Bearer $ANDI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Day Plan",
    "description": "Tracks one planned day, its priorities, and overall status.",
    "fields": {
      "title": { "name": "Title", "type": "text" },
      "planDate": { "name": "Plan date", "type": "date" },
      "focusTheme": { "name": "Focus theme", "type": "text" },
      "status": {
        "name": "Status",
        "type": "select",
        "options": [
          { "value": "ready", "label": "Ready", "color": "blue" },
          { "value": "in-progress", "label": "In progress", "color": "green" },
          { "value": "completed", "label": "Completed", "color": "emerald" }
        ]
      },
      "summary": { "name": "Summary", "type": "text", "variant": "long-text" },
      "itemsCount": { "name": "Items count", "type": "number" },
      "completedItemsCount": { "name": "Completed items count", "type": "number" }
    }
  }'
```

Create sample plan rows with `POST /api/v1/data-definitions/day-plan/data/upsert-many`.

```bash
curl -X POST "https://andibase.com/api/v1/data-definitions/day-plan/data/upsert-many" \
  -H "Authorization: Bearer $ANDI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "data": {
          "title": "Friday plan",
          "planDate": "2026-03-20",
          "ownerName": "Gonzalo",
          "focusTheme": "Ship key product work before noon",
          "status": "ready",
          "dayStart": "09:00",
          "dayEnd": "18:00",
          "topPriorities": [
            "Finish docs updates",
            "Review builder workflow",
            "Clear urgent messages"
          ],
          "constraints": [
            "Team sync at 11:00",
            "Customer call at 16:00"
          ],
          "summary": "Front-load deep work, keep meetings contained, and leave the afternoon for follow-up tasks.",
          "itemsCount": 0,
          "completedItemsCount": 0
        }
      }
    ]
  }'
```

Step 2: Create the day planner agent [#step-2-create-the-day-planner-agent]

Create one workspace agent with handle `day-planner-agent`.

Recommended behavior:

* turn goals, meetings, and constraints into a realistic day plan
* create one plan row for the target day
* create plan-item rows for tasks, meetings, focus blocks, and breaks
* rebalance the day when the user adds, removes, or reprioritizes work
* update completion counts on the parent plan as items are marked done
* make tradeoffs explicit when not everything fits

Recommended agent payload:

```json
{
  "name": "Day Planner Agent",
  "handle": "day-planner-agent",
  "description": "Builds and updates daily plans from goals, meetings, and constraints.",
  "model": "openai/gpt-5.4",
  "capabilities": {
    "webAccess": false,
    "browserAccess": false,
    "objectsAccess": true
  },
  "instructions": "You manage a workspace daily planning workflow. Use the day-plan and day-plan-item data definitions as the source of truth. Be action-oriented: make reasonable assumptions, complete the work when the intended outcome is clear, and avoid asking for confirmation on every small step. When the user asks for a plan, create one day-plan row and the related day-plan-item rows needed to make the schedule actionable. Use realistic time blocks, leave some buffer, and surface tradeoffs when the day is overbooked. When the user marks an item done, update that item and refresh the parent plan completedItemsCount. When the user changes priorities or constraints, update the current plan instead of creating duplicates unless they explicitly ask for a separate plan."
}
```

Create the agent with `POST /api/v1/agents`.

Step 3: Expected operating flow [#step-3-expected-operating-flow]

When a user asks for a day plan, the agent should:

1. Resolve the target day.
2. Capture goals, constraints, and fixed commitments.
3. Create one `day-plan` row.
4. Create the needed `day-plan-item` rows.
5. Keep the plan updated as the day changes.

Recommended acceptance checks [#recommended-acceptance-checks]

An agent should consider the recipe complete only if all of the following are true:

1. `day-plan` exists and includes the required fields.
2. `day-plan-item` exists and includes either the `planId` relationship or the `planRecordId` fallback used by the current public HTTP API flow.
3. `day-planner-agent` exists.
4. At least one sample day-plan row can be created successfully.
5. At least one sample day-plan-item row can be created successfully.
6. The agent can update the plan status or item status without runtime auth errors.

Minimal delivery summary [#minimal-delivery-summary]

When the agent finishes, it should report:

* the created data definition handles
* the created agent handle
* any assumptions made for working hours, priorities, or fixed commitments


## Documentation Navigation
Use these paths to traverse the relevant docs and generated API reference files for the app.
- Day Planner Agent [current] -> `/docs/receipes/day-planner-agent` (source: `content/docs/receipes/day-planner-agent.mdx`)
- andibase Overview -> `/docs` (source: `content/docs/index.mdx`)
- Get started (for AI Agents) -> `/docs/agent-get-started` (source: `content/docs/agent-get-started.mdx`)
- Agent Tools -> `/docs/agent-tools` (source: `content/docs/agent-tools.mdx`)
- Agents -> `/docs/agents` (source: `content/docs/agents.mdx`)
- Agent Auth -> `/docs/api-reference/agent-auth`
- Get agent login request -> `/docs/api-reference/agent-auth/get-api-v1-agent-auth-requests-usercode`
- Exchange agent login -> `/docs/api-reference/agent-auth/post-api-v1-agent-auth-exchange`
- Start agent login -> `/docs/api-reference/agent-auth/post-api-v1-agent-auth-requests`
- Approve agent login -> `/docs/api-reference/agent-auth/post-api-v1-agent-auth-requests-usercode-approve`
- Deny agent login -> `/docs/api-reference/agent-auth/post-api-v1-agent-auth-requests-usercode-deny`
- Agents -> `/docs/api-reference/agents`
- Delete workspace agent -> `/docs/api-reference/agents/delete-api-v1-agents-id`
- List workspace agents -> `/docs/api-reference/agents/get-api-v1-agents`
- Get workspace agent -> `/docs/api-reference/agents/get-api-v1-agents-id`
- List agent chats -> `/docs/api-reference/agents/get-api-v1-agents-id-chats`
- Get agent chat -> `/docs/api-reference/agents/get-api-v1-agents-id-chats-chatid`
- Update workspace agent -> `/docs/api-reference/agents/patch-api-v1-agents-id`
- Create workspace agent -> `/docs/api-reference/agents/post-api-v1-agents`
- Send agent message -> `/docs/api-reference/agents/post-api-v1-agents-id-chats-chatid-messages`
- Apps -> `/docs/api-reference/apps`
- Delete app -> `/docs/api-reference/apps/delete-api-v1-apps-id`
- List workspace apps -> `/docs/api-reference/apps/get-api-v1-apps`
- Get app by id -> `/docs/api-reference/apps/get-api-v1-apps-id`
- Update app -> `/docs/api-reference/apps/patch-api-v1-apps-id`
- Create app -> `/docs/api-reference/apps/post-api-v1-apps`
- Automations -> `/docs/api-reference/automations`
- Delete workspace automation -> `/docs/api-reference/automations/delete-api-v1-automations-id`
- List workspace automations -> `/docs/api-reference/automations/get-api-v1-automations`
- Get workspace automation -> `/docs/api-reference/automations/get-api-v1-automations-id`
- List automation runs -> `/docs/api-reference/automations/get-api-v1-automations-id-runs`
- Get automation run -> `/docs/api-reference/automations/get-api-v1-automations-id-runs-runid`
- Update workspace automation -> `/docs/api-reference/automations/patch-api-v1-automations-id`
- Create workspace automation -> `/docs/api-reference/automations/post-api-v1-automations`
- Run automation -> `/docs/api-reference/automations/post-api-v1-automations-id-run`
- Trigger automation webhook -> `/docs/api-reference/automations/post-api-v1-automations-webhooks-publicid-secret`
- Channels -> `/docs/api-reference/channels`
- Delete channel -> `/docs/api-reference/channels/delete-api-v1-channels-channelid`
- List channels -> `/docs/api-reference/channels/get-api-v1-channels`
- Get channel -> `/docs/api-reference/channels/get-api-v1-channels-channelid`
- Update channel -> `/docs/api-reference/channels/patch-api-v1-channels-channelid`
- Create channel -> `/docs/api-reference/channels/post-api-v1-channels`
- Data -> `/docs/api-reference/data`
- Data Definitions -> `/docs/api-reference/data-definitions`
- Delete data definition -> `/docs/api-reference/data-definitions/delete-api-v1-data-definitions-id`
- List data definitions -> `/docs/api-reference/data-definitions/get-api-v1-data-definitions`
- Get data definition -> `/docs/api-reference/data-definitions/get-api-v1-data-definitions-id`
- Update data definition -> `/docs/api-reference/data-definitions/patch-api-v1-data-definitions-id`
- Create data definition -> `/docs/api-reference/data-definitions/post-api-v1-data-definitions`
- Data SQL Query -> `/docs/api-reference/data-sql-query`
- Run SQL query against workspace data -> `/docs/api-reference/data-sql-query/post-api-v1-data-sql-query`
- Get data by id -> `/docs/api-reference/data/get-api-v1-data-definitions-definitionid-data-id`
- Select all data row ids -> `/docs/api-reference/data/get-api-v1-data-definitions-definitionid-data-select-all`
- List data -> `/docs/api-reference/data/get-api-v1-data-definitions-definitionid-query`
- Patch many data rows -> `/docs/api-reference/data/patch-api-v1-data-definitions-definitionid-data-patch-many`
- Delete many data rows -> `/docs/api-reference/data/post-api-v1-data-definitions-definitionid-data-delete-many`
- Upsert many data rows -> `/docs/api-reference/data/post-api-v1-data-definitions-definitionid-data-upsert-many`
- DuckDB Query -> `/docs/api-reference/duckdb-query`
- Run a DuckDB query against registered sources -> `/docs/api-reference/duckdb-query/post-api-v1-duckdb-query`
- Explorer -> `/docs/api-reference/explorer`
- Delete explorer folder -> `/docs/api-reference/explorer/delete-api-v1-workspace-nodes-nodeid`
- List explorer nodes -> `/docs/api-reference/explorer/get-api-v1-workspace-nodes`
- List explorer folders -> `/docs/api-reference/explorer/get-api-v1-workspace-nodes-folders`
- Rename explorer folder -> `/docs/api-reference/explorer/patch-api-v1-workspace-nodes-nodeid-rename`
- Create folder -> `/docs/api-reference/explorer/post-api-v1-workspace-nodes-folders`
- Move explorer node -> `/docs/api-reference/explorer/post-api-v1-workspace-nodes-nodeid-move`
- Files -> `/docs/api-reference/files`
- List workspace files -> `/docs/api-reference/files/get-api-v1-files`
- Read file content -> `/docs/api-reference/files/get-api-v1-files-fileid-content`
- Create file -> `/docs/api-reference/files/post-api-v1-files`
- Complete file upload -> `/docs/api-reference/files/post-api-v1-files-fileid-complete`
- Presign multipart parts -> `/docs/api-reference/files/post-api-v1-files-fileid-parts`
- Update file content -> `/docs/api-reference/files/put-api-v1-files-fileid-content`
- Messages -> `/docs/api-reference/messages`
- List channel messages -> `/docs/api-reference/messages/get-api-v1-channels-channelid-messages`
- List thread messages -> `/docs/api-reference/messages/get-api-v1-channels-channelid-threads-threadid-messages`
- Create channel message -> `/docs/api-reference/messages/post-api-v1-channels-channelid-messages`
- Create thread message -> `/docs/api-reference/messages/post-api-v1-channels-channelid-threads-threadid-messages`
- Notifications -> `/docs/api-reference/notifications`
- List notification devices -> `/docs/api-reference/notifications/get-api-v1-notifications-devices`
- Check Expo notification receipts -> `/docs/api-reference/notifications/post-api-v1-notifications-receipts`
- Send workspace notifications -> `/docs/api-reference/notifications/post-api-v1-notifications-send`
- Runs -> `/docs/api-reference/runs`
- List workspace runs -> `/docs/api-reference/runs/get-api-v1-runs`
- Get workspace run -> `/docs/api-reference/runs/get-api-v1-runs-runid`
- Threads -> `/docs/api-reference/threads`
- List channel threads -> `/docs/api-reference/threads/get-api-v1-channels-channelid-threads`
- Get thread -> `/docs/api-reference/threads/get-api-v1-channels-channelid-threads-threadid`
- Create thread -> `/docs/api-reference/threads/post-api-v1-channels-channelid-threads`
- Workflows -> `/docs/api-reference/workflows`
- Delete workflow definition -> `/docs/api-reference/workflows/delete-api-v1-workflows-id`
- List workflow definitions -> `/docs/api-reference/workflows/get-api-v1-workflows`
- Get workflow definition -> `/docs/api-reference/workflows/get-api-v1-workflows-id`
- Update workflow definition -> `/docs/api-reference/workflows/patch-api-v1-workflows-id`
- Create workflow definition -> `/docs/api-reference/workflows/post-api-v1-workflows`
- Workspaces -> `/docs/api-reference/workspaces`
- Delete workspace API key -> `/docs/api-reference/workspaces/delete-api-v1-workspaces-workspacehandle-api-keys-keyid`
- Delete workspace credential -> `/docs/api-reference/workspaces/delete-api-v1-workspaces-workspacehandle-credentials-credentialid`
- Delete workspace invitation -> `/docs/api-reference/workspaces/delete-api-v1-workspaces-workspacehandle-invitations-invitationid`
- Delete workspace user -> `/docs/api-reference/workspaces/delete-api-v1-workspaces-workspacehandle-users-userid`
- List my workspaces -> `/docs/api-reference/workspaces/get-api-v1-workspaces`
- List workspace API keys -> `/docs/api-reference/workspaces/get-api-v1-workspaces-workspacehandle-api-keys`
- List workspace credentials -> `/docs/api-reference/workspaces/get-api-v1-workspaces-workspacehandle-credentials`
- List workspace credential tools -> `/docs/api-reference/workspaces/get-api-v1-workspaces-workspacehandle-credentials-credentialid-tools`
- List workspace invitations -> `/docs/api-reference/workspaces/get-api-v1-workspaces-workspacehandle-invitations`
- List workspace users -> `/docs/api-reference/workspaces/get-api-v1-workspaces-workspacehandle-users`
- Create workspace -> `/docs/api-reference/workspaces/post-api-v1-workspaces`
- Create workspace API key -> `/docs/api-reference/workspaces/post-api-v1-workspaces-workspacehandle-api-keys`
- Create workspace credential -> `/docs/api-reference/workspaces/post-api-v1-workspaces-workspacehandle-credentials`
- Invite user to workspace -> `/docs/api-reference/workspaces/post-api-v1-workspaces-workspacehandle-invitations`
- Create workspace user -> `/docs/api-reference/workspaces/post-api-v1-workspaces-workspacehandle-users`
- Apps -> `/docs/apps` (source: `content/docs/apps.mdx`)
- Authentication -> `/docs/authentication` (source: `content/docs/authentication.mdx`)
- Building Blocks -> `/docs/building-blocks` (source: `content/docs/building-blocks.mdx`)
- Data Model -> `/docs/data-model` (source: `content/docs/data-model.mdx`)
- Embedded Host Actions -> `/docs/embedded-host-actions` (source: `content/docs/embedded-host-actions.mdx`)
- Introduction -> `/docs/introduction` (source: `content/docs/introduction.mdx`)
- Recipes -> `/docs/receipes` (source: `content/docs/receipes/index.mdx`)
- Construction Site Visit Agent -> `/docs/receipes/construction-site-visit-agent` (source: `content/docs/receipes/construction-site-visit-agent.mdx`)
- Daily Lead Qualification Agent -> `/docs/receipes/daily-lead-qualification-agent` (source: `content/docs/receipes/daily-lead-qualification-agent.mdx`)
- Expense Tracker -> `/docs/receipes/expense-tracker` (source: `content/docs/receipes/expense-tracker.mdx`)
- Legal Case Tracker -> `/docs/receipes/legal-case-tracker` (source: `content/docs/receipes/legal-case-tracker.mdx`)
- Spare Parts Request Agent -> `/docs/receipes/spare-parts-request-agent` (source: `content/docs/receipes/spare-parts-request-agent.mdx`)
- Weekly Report Email Agent -> `/docs/receipes/weekly-report-email-agent` (source: `content/docs/receipes/weekly-report-email-agent.mdx`)
- UI Components -> `/docs/ui-components` (source: `content/docs/ui-components.mdx`)