Skip to content

Builder: an If after a list (calendar, inbox…) and after an Ask step's reply #264

Closed

Description

@AncungAulia

@Lexirieru Ancung (FE) tried a job that can't be built today: read the calendar; if there is anything on it, email me a morning note about it; if not, stop. In the Builder, If is locked after "Read the calendar".

Why

  • An If compares one number or one text (eq, ne, lt, lte, gt, gte in builder.ts). The FE offers only fields that aren't lists (comparable in apps/fe/src/modules/builder/data/draft.ts).
  • "Read the calendar" gives events, a list, so there is nothing to compare. "Read the inbox", "Find free time", "Read a Notion database", "Read a Google Sheet" and "List Zoom meetings" are the same.
  • An Ask step's reply can't be read by an If either.
  • events.length doesn't work. Mastra validates each predicate path against the step's output schema before the run (validatePath in @mastra/core/dist/validate-*.js: "Predicate path … does not exist in the known schema"), and an array schema has no length. Read in the installed package, not run (the engine's unit tests don't start on Windows, see the path issue).

Proposed

  1. A count on every tool that returns a list. It's a number beside the list: events + count for the calendar, emails + count for the inbox, and the same for slots, rows, values and meetings. The If then compares "Number of events > 0".
    • The contents still reach the email: a list can already go into an Ask step's prompt ({Calendar events}), and the Mind writes the note from it.
    • So the job above becomes: Read the calendar → If Number of events > 0 → Ask "write a morning note about {Calendar events}" → Email me; otherwise it stops.
  2. An If that can read an Ask step's reply (its text). This is for conditions about the contents ("is there an email from my boss?", "is any meeting with a client?"): the Mind answers yes or no, and the If compares that text. It needs the agent node's output schema to carry text where the If's validation can see it. Is that already so?

FE (mine, as soon as the engine has them)

  • Number fields (count, kind number) in builder/data/tools.ts, shown as "Number of events", "Number of emails", and so on.
  • An Ask step listed in an If's "Look at" as "{name}'s answer", with a hint to make it reply yes or no.

Meanwhile the FE will say why the If is locked, instead of "Add a check or a website first", which read like a bug.

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Nov 11, 2026
  2. Lexirieru commented on Nov 11, 2026

    @Lexirieru
    Contributor

    Engine part merged in #265: count on every list tool, so "Number of events > 0" works (tested end to end and under load). An If on an Ask reply works only as an exact text match (details in #265). @AncungAulia the FE fields are listed in the #265 comment.

  3. added a commit that references this issue on Nov 12, 2026
  4. Lexirieru commented on Nov 12, 2026

    @Lexirieru
    Contributor

    Done: engine count (#265) and the FE fields (#268). An If on an Ask reply is left out on purpose: the engine compares exact text only ("Yes" ≠ "yes", #265). It can be a new issue after the hackathon if we want it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions