Docs
API 1.39
Status
Actions

await_input

The `await_input` step.

Pauses the job as awaiting_input until a value such as a one-time code is supplied, then stores it in vars.<name>. The string form names the input.

Type: string or object

#Keys

KeyTypeDescription
await_input.collect"api" | "hosted"How the value is collected: api (the default), through the resume endpoint, or hosted, on a page Kaabist hosts.
await_input.expiresstringHow long the job waits for the value, as a duration such as 24h. Defaults to 24h, at most 7d.
await_input.hostedobjectSettings for collect: "hosted"; lint warns W007 when a hosted input has no notify.
await_input.hosted.notify"email" | "none"Who is told the hosted page is waiting: email or none.
await_input.hosted.tostringThe address the notification goes to, a template.
await_input.namestringThe variable the value lands in, as vars.<name>. Must match ^[a-zA-Z_][a-zA-Z0-9_]{0,63}$.
await_input.patternstringA regular expression the supplied value must match.
await_input.promptstringThe question shown to whoever supplies the value, a template.
await_input.ttlstringHow long the browser is held open while waiting, as a duration such as 5m. Defaults to 5m, at most 15m; after that the job is checkpointed and the browser released.
await_input.type"string" | "number" | "secret"The value's type: string (the default), number or secret.

Every step also takes the common step keys: expect, id, if, name, on_error, optional, retry, side_effect, timeout_ms, x_kaab.

#Example

{
  "await_input": {
    "name": "code",
    "prompt": "Enter the code we e-mailed you",
    "type": "string",
    "pattern": "^[0-9]{6}$",
    "ttl": "5m",
    "expires": "24h",
    "collect": "hosted",
    "hosted": {
      "notify": "email",
      "to": "{{inputs.email}}"
    }
  }
}

From the contract fixture hosted-await-input, a program the test suite validates.

Was this page helpful?