Exposed Variables#

Variable Sharing Across Steps

Workflows often need to reuse values across nodes. Flowkit supports passing key-value pairs between steps using GRPC input and output maps.

Examples:

  • Extracting a value in Function A

  • Passing it into Function B as part of the same session

Key Scoping

Variables are scoped per session. The same keys can exist in different sessions without conflict.

Reserved keys include:

  • __user

  • __session

  • __workflow

These are injected by the AALI Agent during request initialization.

Access Pattern (Go)

Access input variables using standard Go map syntax:

customerID, ok := req.Input["customer_id"].GetStringValue()
if !ok {
    return nil, errors.New("missing customer_id")
}

Create output using the Flowkit response format:

return &flowkitpb.FunctionResponse{
    Output: map[string]*structpb.Value{
        "status": structpb.NewStringValue("ok"),
        "next":   structpb.NewStringValue("complete"),
    },
}