Build an AnswerSet action
End-to-end walkthrough for connecting a governed answer to a reusable HTTP ExecutionSet.
This guide builds an AnswerSet → ExecutionSet workflow. The AnswerSet determines a governed answer. The ExecutionSet sends a typed HTTP request to an approved external service. You can test the answer without making any outbound call, then separately approve a real action.
Connections default to Manual and require explicit confirmation to run. Automatic connections can be enabled by an authorized actor after reviewing the current ExecutionSet definition and mapping. Once approved, ordinary Question Key calls can execute those Automatic connections.
Before you begin
You need an active workspace and permissions to manage AnswerSets and ExecutionSets. For testing a real action, the caller must also have executions.evaluate. A Question Key cannot manage or explicitly select actions, but can trigger its AnswerSet’s already-approved Automatic connections. The outbound destination must be HTTPS and enabled by the platform operator; saving a function is not permission to call an arbitrary host.
If you have never created an AnswerSet, complete the AnswerSet QuickStart first.
1. Create an AnswerSet
Open Answers and create an AnswerSet using Seed with provider or Build manually. For this example, choose Text output and add or approve Knowledge that can resolve a question to a color.
In Try it out, enter What color is grass?. Confirm that the answer is the intended plain-text value such as green. If this is a strict-answer use case, configure and test the output rules before connecting actions.
2. Create the reusable HTTP function
Select your workspace, then open Executions → New ExecutionSet.
| Field | Example |
|---|---|
| Name | notify_color |
| Method | POST |
| Destination | https://api.example.org/notify (replace with your approved real endpoint) |
| Required request field | color as Text |
| Required response field | accepted as Yes/No |
Choose Create ExecutionSet. Creation only saves a definition; it does not send a request.
Your destination must respond with JSON matching the declared schema, for example {"accepted":true}. For a service that expects a different body, configure a custom payload.
3. Connect it to the AnswerSet
Use the AnswerSet action management API to create a binding for notify_color with its ExecutionSet ID, a recognizable connection name, trigger_mode: "manual", and the typed mapping below. The current Flow graph resource dropdowns do not manage these runtime connections; saving a graph does not attach it to incoming questions.
Under the hood, this mapping is:
{"color":{"$ref":"answer.value"}}
For a JSON AnswerSet, you can instead map Answer JSON field to a path, such as answer.value.color. This inserts the field with its original JSON type rather than serializing the whole object into a string.
Review the destination, HTTP method, and mapping before saving. Connecting does not execute the action.
4. Preview, then make one real call
In the AnswerSet’s Test or Try it out area:
- Ask the question and inspect its answer and output type.
- Find Run a connected action, choose your connection, and review what will be sent.
- Confirm the action only when you intend to make the outbound HTTP request.
- Inspect the action result, status, run ID, and linked answer run ID.
The explicit action flow resolves the question again under current policy before mapping inputs. A provider may be called again if Knowledge does not satisfy the question. The HTTP request is not a dry run and may change state in the destination service.
A successful invocation can return:
{
"run_id": "00000000-0000-0000-0000-000000000003",
"answer_run_id": "00000000-0000-0000-0000-000000000004",
"output": {"accepted": true},
"latency_ms": 189
}
These identifiers and timings are examples only.
5. Verify the operational boundary
- A normal
POST /v1/questionsrequest with a Question Key runs the AnswerSet’s approved Automatic connections, if any. Manual connections remain answer-only until explicitly invoked. Use the same UUID idempotency key on retries and reviewactionsevidence before attempting a new delivery. - A saved connection cannot bypass denied destinations, input/output schema validation, AnswerSet output rules, or relevant governance.
- A disconnected or deactivated ExecutionSet should not be relied on as an active action.
- The action history records operational evidence, not the raw answer, request context, or external response body.
For a server-side invocation, see the ExecutionSets API guide. For outbound destination restrictions and action authorization, see HTTP execution security.
Troubleshooting
| Symptom | What to check |
|---|---|
| Action is not selectable | Active workspace, ExecutionSet state, and read permissions |
| Cannot connect | Destination input schema, mapping paths and required fields |
| HTTP action blocked | Action authorization, configured hostname policy, public DNS/IP validation, and verified egress; the checked-in beta host policy is *, not an exact-host allowlist (see security) |
| Missing input before request | JSON field path, typed output and caller-supplied context |
| Output rejected | HTTP status, valid JSON, declared response schema and AnswerSet output policy |
Duplicate execution rejected with 409 |
An idempotency key was already reserved; inspect evidence before submitting a new request |