Connect ExecutionSets to AnswerSets
Connect reusable HTTP actions to governed answers using Manual confirmation or approved Automatic execution.
An AnswerSet resolves a question into a governed, typed result. An ExecutionSet performs a reusable action. AnswerSet action bindings connect the two without embedding HTTP URLs in individual AnswerSets.
Connect an action
Independent Flows are a separate top-level LakeShark product. An AnswerSet does not need a Flow, and Question Keys do not grant general Flow execution rights. Some beta workspaces may retain legacy AnswerSet-attached graph behavior during migration; confirm the actual deployed behavior before relying on it. See Flow Studio and its API rollout boundary. The Manual/Automatic connection APIs below retain their own lifecycle; saving an independent Flow does not create one of these bindings.
- Under Executions, create an HTTP ExecutionSet with its HTTPS destination and typed input/output fields.
- Use
POST /v1/answer-sets/{id}/execution-bindingswith the ExecutionSet ID, a connection name, typedinput_mapping, andtrigger_mode(manualby default). Automatic mode also requiresexecutions.evaluate. - Review the destination, method, and mapping before creating or approving a binding. Saving a binding never invokes the external service.
- Open Test, ask a question, and inspect the answer. Existing connections can appear under Run a connected action for an authorized operator. Confirm only when intending a real HTTP request; alternatively use the explicit-run API below.
- Review the JSON result and the answer and action run IDs. Inspect recent action history through the management API.
External actions may have side effects. Manual bindings require an explicitly authorized run. Approved Automatic bindings may execute with AnswerSet Question Keys. Existing beta tenants with legacy attached graphs must inspect their deployed routing before assuming when an action will fire. A separate Flow orchestrates ExecutionSets through its own authorization once independent Flow execution is released.
Example
Suppose your AnswerSet resolves an approved text value of Blue. Your HTTP ExecutionSet accepts this schema:
{
"type": "object",
"properties": {"color": {"type": "string"}},
"required": ["color"],
"additionalProperties": false
}
To map the typed Answer value to the color input, use:
{
"color": {"$ref": "answer.value"}
}
The external service receives exactly:
{"color":"Blue"}
References are typed, deterministic, and never executed as code. The same mechanism supports numbers, booleans, arrays, and objects when the destination schema permits those types. Request context can be referenced as context.customer.id, but context is caller-supplied and does not prove identity.
Connect a structured JSON AnswerSet
If your AnswerSet’s governed output is a JSON object:
{"color":"green","confidence":95}
and the ExecutionSet input field color requires Text, select Answer JSON field and enter color for its field path. The typed connection mapping is:
{
"color": {"$ref": "answer.value.color"}
}
The HTTP ExecutionSet receives {"color":"green"} as its input without turning the entire AnswerSet output into a string. Nested dictionary paths such as answer.value.customer.id are also supported. Field references are bounded and cannot access arrays by index, reserved properties, arbitrary code, or external network resources.
Missing JSON keys and incompatible types fail before outbound HTTP. For non-JSON AnswerSets, Answer value (typed) remains the straightforward choice.
API
Use the authenticated Answers API at https://lakeshark.dev/api/answers.
| Operation | Method | Route | Scopes |
|---|---|---|---|
| List connections | GET | /v1/answer-sets/{id}/execution-bindings |
answers.read and executions.read |
| Connect | POST | /v1/answer-sets/{id}/execution-bindings |
answers.write and executions.write; also executions.evaluate for Automatic |
| Set Manual/Automatic or reapprove | PATCH | /v1/answer-sets/{id}/execution-bindings/{binding_id} |
answers.write, executions.write; also executions.evaluate for Automatic |
| Disconnect | DELETE | /v1/answer-sets/{id}/execution-bindings/{binding_id} |
answers.write and executions.write |
| Recent action history | GET | /v1/answer-sets/{id}/execution-runs |
answers.read and executions.read |
| Explicitly execute | POST | /v1/answer-sets/{id}/execution-bindings/{binding_id}/run |
answers.write and executions.evaluate |
| Run approved Automatic connections | POST | /v1/answer-sets/{id}/ask-and-execute |
answers.write and executions.evaluate |
| Question Key workflow | POST | /v1/questions |
Bound AnswerSet Question Key and its approved action behavior |
Connect request:
{
"name": "Notify service",
"execution_set_id": "00000000-0000-0000-0000-000000000001",
"input_mapping": {"color": {"$ref": "answer.value"}},
"trigger_mode": "manual"
}
Explicit run request:
{
"question": "What color is grass?",
"context": {},
"idempotency_key": "00000000-0000-0000-0000-000000000002"
}
Example response:
{
"run_id": "00000000-0000-0000-0000-000000000003",
"answer_run_id": "00000000-0000-0000-0000-000000000004",
"output": {"accepted": true},
"latency_ms": 189
}
The IDs and latency above are illustrative. Create a fresh random UUID for each intentionally new run. Repeating the same key returns HTTP 409 and never replays the action. Network failures can leave the external outcome uncertain: inspect downstream evidence before intentionally submitting a new key.
Safety and operational boundaries
- Connections default to Manual. Automatic mode requires separate execution authorization and is capped at eight active Automatic connections per AnswerSet. A Question Key can trigger its AnswerSet’s authorized Automatic bindings; inspect the deployed routing when legacy attached graphs are present. Scheduling and automatic retry after uncertain delivery are not provided.
- Changing an ExecutionSet definition invalidates its Automatic approval until an authorized user reviews the new definition and PATCHes the binding with
{"trigger_mode":"automatic"}. Switching to Manual does not invoke the endpoint. - Only functions from the active workspace can be attached. Scoped relational integrity and PostgreSQL forced row-level security prevent cross-tenant bindings.
- Managing or explicitly running an action requires the documented scopes. Question Keys have no general
executions.evaluatepermission and cannot select arbitrary actions, but may trigger already-approved Automatic connections for their own AnswerSet. - Validated output contracts and applicable governance are enforced before mapping and HTTP execution. Invalid references and type mismatches prevent the HTTP call.
- Execution requires the configured hostname policy and separately enforced egress protections; without verified egress the runtime fails closed. The checked-in beta Executions Deployment sets the hostname policy to
*, so it does not enforce individual external-host approvals. Public-IP restrictions and action authorization still apply. See HTTP execution security. - The action audit contains actor, binding, status, latency, and associated answer run ID. It does not store raw answer text, request context, or external response bodies. Read recent action runs through
GET /v1/answer-sets/{id}/execution-runs, retaining explicit status for outcomes that remain unconfirmed. - The feature requires the corresponding Answers backend and PostgreSQL schema bootstrap. Source and GitOps state do not alone prove the current live cluster has been updated; verify rollout and action evidence before enabling production side effects.