Overview
Resume a previously created session by callinginit({ sessionId })
. This allows you to add more steps and events to an existing workflow.
Syntax
Parameters
The ID of the session to continue. This is returned when creating a session.
Returns
Returns a Promise that resolves to the real session ID (string).Examples
Basic Usage
Workflow Continuation Pattern
Error Recovery
Use Cases
1. Long-Running Workflows
Perfect for workflows that span multiple executions:2. Distributed Processing
When different services handle different parts of a workflow:3. Retry Logic
Important Notes
- The session must exist and not be finished
- Only one session can be active at a time
- Calling
init({ sessionId })
replaces any previous active session in this process
Error Cases
Error | Cause | Solution |
---|---|---|
”SDK not initialized” | init() not called | Call lai.init() first |
”Session not found” | Invalid session ID | Verify session ID exists |
”Session already finished” | Session was ended | Create a new session |
See Also
- init - Initialize or continue a session
- updateSession - Update session metadata
- endSession - End the current session