Lesson 5: FooLogicStep — Deterministic Bridge
Role in the Flow
After both cities are captured, WeatherStep transitions into FooLogicStep. No LLM is involved — this is pure control-plane logic.
Implementation
export class FooLogicStep extends LogicStep {
constructor(flow: Flow, isActive = false) {
super(FooLogicStep, flow, isActive);
}
public async runLogic(): Promise<LogicResponseType> {
return { step: GooLogicStep, state: { fooData: 'fooValue' } };
}
}
- Synchronously computes/attaches
fooData. - Immediately hands control to
GooLogicStep. - Skips the LLM loop entirely (fast and cheap).
Pattern Notes
- Use LogicSteps for deterministic routing, DB writes, or enrichment.
- Return
{ step, state }to pass values forward without touching memory history.
Next: GooLogicStep (another deterministic hop that routes into FavoritesStep).