picoflow.io

Lesson 6: GooLogicStep — Into Favorites


Role in the Flow

GooLogicStep receives control from FooLogicStep, attaches another piece of state, and routes to FavoritesStep.

export class GooLogicStep extends LogicStep {
  constructor(flow: Flow, isActive = false) {
    super(GooLogicStep, flow, isActive);
  }

  public async runLogic(): Promise<LogicResponseType> {
    return { step: FavoritesStep, state: { gooData: 'gooValue' } };
  }
}
  • Still no LLM call.
  • Packs gooValue into the next step’s state.

Why Two LogicSteps?

  • Keep each deterministic operation tiny and testable.
  • Mirror real-world sequences (e.g., validate → enrich → route).
  • Preserve observability in the session document (sequence shows both steps).

Next: FavoritesStep — enforce structured output before looping back to NameStep.