Skip to main content

WorkflowAgent

Trait WorkflowAgent 

Source
pub trait WorkflowAgent<Input, Output> {
    // Required methods
    fn spec(&self) -> AgentSpec;
    fn build_prompt_packet(
        &self,
        event: &Event,
        input: Input,
    ) -> AgentPromptPacket<Input>;
    fn validate_output(&self, output: Result<Output>) -> Result<Output>;
}
Expand description

Contract implemented by app workflow agents that prepare safe prompt packets.

Implementors expose their immutable AgentSpec, package an event and typed input into an AgentPromptPacket, then validate model/tool output before it is accepted as a draft or evidence bundle. The trait is intentionally about preparing and checking workflow artifacts; it does not grant authority to write back to Gingr, send pet-parent messages, change labor schedules, or mutate reservations.

Required Methods§

Source

fn spec(&self) -> AgentSpec

Returns the agent’s operational specification.

The spec names the workflow, states its labor/customer-service purpose, lists only the read or draft tools the runner may expose, and records the review gates that must remain outside model control.

Source

fn build_prompt_packet( &self, event: &Event, input: Input, ) -> AgentPromptPacket<Input>

Builds the prompt packet for one workflow event and typed input payload.

The returned packet should contain source event context, workflow input, policy instructions, and output schema expectations sufficient for an agent to draft or summarize evidence without taking live operational action.

Source

fn validate_output(&self, output: Result<Output>) -> Result<Output>

Validates a proposed workflow output before downstream app code can use it.

Implementations should preserve deterministic policy failures and reject unsafe output rather than treating generated text as authority to mutate bookings, messages, schedules, incident records, or customer commitments.

Implementors§