ExecutionsResource on the Figranium Kotlin SDK gives you full visibility and control over every task run. Use it to list past executions, inspect a single run, clean up history, stop active runs, subscribe to a live Server-Sent Events stream of execution updates, and watch a specific execution by polling for status changes.
ExecutionsResource.kt
Methods
list
list
- HTTP endpoint:
GET /api/executions/list(default) orGET /api/executions - Signature:
suspend fun list(apiKeyRoute: Boolean = true, options: RequestOptions = RequestOptions()): List<Execution>
GET /api/executions/list, which is the route intended for API-key access. If you pass apiKeyRoute = false, the SDK switches to GET /api/executions instead.Most callers should leave
apiKeyRoute at its default (true). Only override it when your deployment requires the alternate route.list_executions.kt
get
get
- HTTP endpoint:
GET /api/executions/{id} - Signature:
suspend fun get(id: String, options: RequestOptions = RequestOptions()): Execution
get_execution.kt
delete
delete
- HTTP endpoint:
DELETE /api/executions/{id} - Signature:
suspend fun delete(id: String, options: RequestOptions = RequestOptions()): JsonObject
delete_execution.kt
clear
clear
- HTTP endpoint:
POST /api/executions/clear - Signature:
suspend fun clear(options: RequestOptions = RequestOptions()): JsonObject
clear_executions.kt
stop
stop
- HTTP endpoint:
POST /api/executions/stop - Signature:
suspend fun stop(runId: String, options: RequestOptions = RequestOptions()): JsonObject
stop_execution.kt
stream
stream
- HTTP endpoint:
GET /api/executions/stream - Signature:
fun stream(options: RequestOptions = RequestOptions()): Flow<StreamEvent<JsonElement>>
accept and auth headers, not default or per-call headers, and uses options.timeoutMillis.For details on the StreamEvent shape and how cancellation works, see Streaming. For error handling, see Errors.stream_executions.kt
watch
watch
- HTTP endpoint:
GET /api/executions/{id}(polled) - Signature:
fun watch(executionId: String, intervalMillis: Long = 1_000, options: RequestOptions = RequestOptions()): Flow<Execution>
get at the given interval and yields an Execution only when the status changes. The stream finishes automatically when the execution reaches an outcome or status of success, error, stopped, crashed, or anti_bot. Cancelling the collecting coroutine cancels the polling loop.watch_execution.kt
End-to-end example
This example lists recent executions, inspects the newest one, and stops it if it is still running.execution_workflow.kt
Related resources
Tasks
Create and manage the tasks you execute.
Streaming
Collect execution and selector streams with Flow.
Request options
Pass custom headers and per-request timeouts.
Errors
Handle FigraniumException responses.