Overview
TheendStep function ends an active step, optionally updating its evaluation and other properties before completion.
Syntax
Parameters
Optional object with the following properties:
Returns
Returns a Promise that resolves to void.Examples
Basic Usage
End Specific Step
Error Handling Pattern
With Conditional Scoring
Sequential Steps with Evaluation
Best Practices
1. Always End Steps
2. Meaningful Evaluations
3. Use Context Managers for Self-Contained Workflows
PreferwithLucidic when a session should end at the end of the workflow. See Session Context.
Notes
- If no 
stepIdis provided, ends the current active step - Steps are automatically ended when the session ends
 - All parameters are optional - you can call with no arguments
 - The step must exist and not already be ended
 
See Also
- createStep - Create a new step
 - updateStep - Update step properties
 - endSession - End the session