Skip to main content

Ask Agent

Category: System Ask Agent block screenshot

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

InputRequiredValue KindTypesEnum Values
taskyesexpressionstring
inputTextnoexpression
contextTextnoexpression
providerRequirementnoexpression
outputSchemaJsonnoexpression
repairAttemptsnoexpression
timeoutMsnoexpression
maxOutputCharsnoexpression
onFailurenoexpressionenum-stringSTOP, SET_NOT_OK_AND_CONTINUE
storeOkInnovariable-name
storeErrorInnovariable-name
storeTextInnovariable-name
storeRawPathInnovariable-name
storeResultJsonPathInnovariable-name
storeFieldsInnoobject

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 providerRequirement to agent.provider and resolves it through the shared Workflow AI provider-profile/capability logic. Missing or ambiguous providers fail closed unless onFailure continues.
  • onFailure defaults to STOP. SET_NOT_OK_AND_CONTINUE stores false in storeOkIn, stores the error string in storeErrorIn, and continues.
  • Use storeTextIn for free text or canonical validated JSON text.
  • With outputSchemaJson, storeFieldsIn can 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.
  • repairAttempts defaults to 0, is capped at 5, and requires outputSchemaJson; each retry asks the provider to correct a failed structured response using the validation error and previous response text.
  • storeRawPathIn stores the path of an internal runtime diagnostic artifact containing the final provider text. storeResultJsonPathIn requires outputSchemaJson and 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.
  • timeoutMs and maxOutputChars are passed to the shared provider invocation path. Omitted timeoutMs uses the product default for the provider adapter. timeoutMs: 0 explicitly 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.

kind: Pattern · format: runtime-dsl · validation: Schema only

Topics: workflow ai, askAgent, structured output, json schema, field projection

Source: patterns/ex-workflow-ai-structured-extract-text-fields.json

Download 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.

kind: Recipe · format: runtime-dsl · validation: Schema only

Topics: workflow ai, askAgent, structured output, transcript, transcript proofreading, experimental

Source: recipes/ex-semantic-proofread-selected-clip-transcript-with-workflow-ai.json

Download JSON