EngineVersion 1contextActions

context:AskQuestion

Prompt the user for input during workflow execution.

Payload: context:QuestionPayload

Result: context:Answer

Suspends execution and presents a question to the user, resuming when they respond. The result is a ctx:Answer resource with the user's response.

USE ctx:AskQuestion when:

  • You need free-text input from the user (name, description, confirmation)
  • You need the user to select from a set of choices
  • You need approval before proceeding with a destructive or irreversible operation

The result variable binds to a ctx:Answer resource. Access the response via ctx:value. For multi-select, the answer has multiple ctx:value triples.

# Free-text input — result is a ctx:Answer resource
DESCRIBE ?answer WHERE {
  ?answer ctx:AskQuestion ([
    ctx:questionLabel "What do you want to name this repo?"
  ]) .
}
# ?answer ctx:value "my-new-repo" .

# Selection with choices
DESCRIBE ?answer WHERE {
  ?answer ctx:AskQuestion ([
    ctx:questionLabel "Which repository?" ;
    ctx:questionChoices (<urn:repo:a> <urn:repo:b>)
  ]) .
}
# ?answer ctx:value <urn:repo:selected> .

# Multi-select
DESCRIBE ?answer WHERE {
  ?answer ctx:AskQuestion ([
    ctx:questionLabel "Select issues to prioritize" ;
    ctx:questionChoices (<urn:issue:1> <urn:issue:2> <urn:issue:3>) ;
    ctx:allowMultiple true
  ]) .
}
# ?answer ctx:value <urn:issue:1> .
# ?answer ctx:value <urn:issue:2> .