Ask Agent
Runs a bounded request through the configured Workflow AI provider. `providerRequirement` defaults to `agent.provider`; use a scoped capability such as `agent.provider.lmstudio` only when the workflow requires that provider class. Declare the same provider capability in top-level `requires` so preflight can fail closed before execution. Use `storeTextIn` for free text or canonical structured JSON text. With `outputSchemaJson`, the runtime validates the structured result, can retry with `repairAttempts` capped at 5, and `storeFieldsIn` can project flat scalar or scalar-array JSON fields into variables. `storeRawPathIn` stores the path of a runtime diagnostic artifact containing the final provider text. `storeResultJsonPathIn` stores the path of the successful validated JSON artifact and requires `outputSchemaJson`. `onFailure: SET_NOT_OK_AND_CONTINUE` lets a workflow record provider failures and continue; otherwise provider errors stop the run.
Inputs
| Input | Required | Value Kind | Types | Enum Values |
|---|---|---|---|---|
task | yes | expression | string | — |
inputText | no | expression | — | — |
contextText | no | expression | — | — |
providerRequirement | no | expression | — | — |
outputSchemaJson | no | expression | — | — |
repairAttempts | no | expression | — | — |
timeoutMs | no | expression | — | — |
maxOutputChars | no | expression | — | — |
onFailure | no | expression | enum-string | STOP, SET_NOT_OK_AND_CONTINUE |
storeOkIn | no | variable-name | — | — |
storeErrorIn | no | variable-name | — | — |
storeTextIn | no | variable-name | — | — |
storeRawPathIn | no | variable-name | — | — |
storeResultJsonPathIn | no | variable-name | — | — |
storeFieldsIn | no | object | — | — |
Notes
- Statement block for a bounded Workflow AI runtime call. It supports free-text output and the first JSON-schema structured-output path through
outputSchemaJson. - Defaults
providerRequirementtoagent.providerand resolves it through the shared Workflow AI provider-profile/capability logic. Missing or ambiguous providers fail closed unlessonFailurecontinues. onFailuredefaults toSTOP.SET_NOT_OK_AND_CONTINUEstoresfalseinstoreOkIn, stores the error string instoreErrorIn, and continues.- Use
storeTextInfor free text or canonical validated JSON text. - With
outputSchemaJson,storeFieldsIncan project top-level structured JSON fields into variables. Projected values must be scalar values or arrays of scalar values; missing fields or nested object values fail closed. repairAttemptsdefaults to0, is capped at5, and requiresoutputSchemaJson; each retry asks the provider to correct a failed structured response using the validation error and previous response text.storeRawPathInstores the path of an internal runtime diagnostic artifact containing the final provider text.storeResultJsonPathInrequiresoutputSchemaJsonand stores the path of the successful validated JSON artifact. These artifact paths are reliable within the same workflow run, but not guaranteed to persist across later runs.timeoutMsandmaxOutputCharsare passed to the shared provider invocation path. OmittedtimeoutMsuses the product default for the provider adapter.timeoutMs: 0explicitly disables the per-call wall-clock timeout and should be reserved for workflows that have another clear cancellation path. The current transport is non-streaming; robust weak-local-model support still needs the planned streaming/idle-timeout variant.
Examples
Structured Workflow AI Extract Text Fields
Calls the configured Workflow AI provider with a small JSON Schema, stores canonical JSON text, projects top-level fields into variables, and records run-scoped diagnostic artifact paths without mutating Premiere.
Topics: workflow ai, askAgent, structured output, json schema, field projection
Source: patterns/ex-workflow-ai-structured-extract-text-fields.json
Experimental Whole-Transcript JSON Proofread Shape
Demonstrates the safe bounded askAgent handoff pattern: export, structured Workflow AI call, schema validation, confirmation, and import. The whole-Premiere-transcript-JSON proofreading roundtrip is experimental and is not a recommended production proofreading workflow.
Topics: workflow ai, askAgent, structured output, transcript, transcript proofreading, experimental
Source: recipes/ex-semantic-proofread-selected-clip-transcript-with-workflow-ai.json