Nested statements within this block.
Each statement represents a step within the grouped operation. Can include any valid statement type:
IApiOperateStatement for API operations with automatic data capture
within conditional logicMaintains the same ordering significance as the root function's statements array.
🚨 CRITICAL: DO NOT PUT EXPRESSIONS DIRECTLY IN STATEMENTS ARRAY! 🚨
This array ONLY accepts IStatement types. If you need to execute an
expression (like predicates, function calls, etc.), you MUST wrap it in
IExpressionStatement:
❌ WRONG - Expression directly in statements array:
statements: [
{ type: "apiOperateStatement", ... },
{ type: "conditionalPredicate", ... } // ❌ This is IExpression, not IStatement!
]
✅ CORRECT - Expression wrapped in IExpressionStatement:
statements: [
{ type: "apiOperateStatement", ... },
{
type: "expressionStatement", // ✅ Statement wrapper
expression: {
type: "conditionalPredicate", ... // ✅ Expression properly contained
}
}
]
Statement Types (can go directly in array):
IApiOperateStatementIExpressionStatementIIfStatementIReturnStatementIThrowStatementExpression Types (must be wrapped in IExpressionStatement):
IEqualPredicate, IConditionalPredicate, etc.ICallExpressionIExpression typeExample business context - Block: "Premium Customer Workflow"
Type discriminator.
Block for grouping statements in specific structural contexts.
SPECIAL USE ONLY: This type represents a block of statements and should only be used in specific contexts where statement grouping is structurally required:
If/else statement branches
Arrow function bodies: IArrowFunction.body
Other contexts requiring explicit block scoping
Unlike a block statement, this is not a statement itself but a structural container for statements. For normal test function flow, use individual statements directly rather than wrapping them in blocks.
Updated for API-first workflow: Blocks can now contain
IApiOperateStatementfor API operations with automatic data capture, predicate expressions for validations, and other statement types as needed within conditional logic or function bodies.AI function calling restriction: Do not use for general statement grouping in main function flow. Reserve for structural requirements only (conditional branches, function bodies).