Skip to content

Latest commit

 

History

History
79 lines (58 loc) · 3.04 KB

runware_serverless_apps_invoke.md

File metadata and controls

79 lines (58 loc) · 3.04 KB

runware serverless apps invoke

Invoke an application endpoint

Synopsis

Submit a JSON payload to a named application endpoint.

endpointPath is the path apps endpoints reports, one or more lowercase segments joined by slashes (e.g. infer, or v1/chat/completions for a server that answers on a nested route). A leading slash is rejected.

The default is async: the command prints the accepted task id. Pass --wait to poll until the task is completed or failed, and --timeout to bound that wait.

--sync uses the sync invocation endpoint. If the platform wait window expires, the command polls the returned task id; it never treats expiry as a failure and never resubmits. --timeout bounds that sync call and the poll together, and requires --wait or --sync.

A client-generated task id is sent with every invoke. Omit --task-id to generate one. Resubmitting the same id returns the task it already names instead of starting a second run.

When no response arrives (a dropped connection, a body that cannot be read, or a server error from a proxy such as Cloudflare), the command fails with code responseLost, the task id it sent in taskUUID, and how to read that task. With --sync or --wait it polls that id first, so a run the worker finished is neither lost nor run again.

runware serverless apps invoke <appId> <endpointPath> [flags]

Examples

  # list endpoint paths, then invoke asynchronously
  runware serverless apps endpoints my-app
  runware serverless apps invoke my-app infer -f payload.json

  # wait for a completed task (sync, then poll if the wait window expires)
  runware serverless apps invoke my-app infer --sync -f payload.json

  # async invoke and poll
  runware serverless apps invoke my-app infer --wait --timeout 2m -f payload.json

  # retry a lost response without starting a second task
  runware serverless apps invoke my-app infer --task-id 7c9e6679-7425-40de-944b-e07fc1f90ae7 -f payload.json

Options

  -f, --body string              JSON payload file, or - for stdin (default {})
  -h, --help                     help for invoke
      --poll-interval duration   Polling interval when waiting for a task (default 2s)
      --sync                     Use sync invocation and wait for a terminal task
      --task-id string           Client task id (UUID); generated if omitted
      --timeout duration         Maximum time to wait (0 = no limit)
      --wait                     Poll until the task is completed or failed

Options inherited from parent commands

      --debug              Show full debug output
  -e, --env name           Environment the app runs in (default RUNWARE_ENV, else the config's environment, else production)
      --environment name   Alias for --env
  -F, --format string      CLI output format: table, json, yaml (default "table")
      --transport string   Transport protocol: ws (WebSocket) or http (REST) (default "ws")
  -v, --verbose            Show request/response details

SEE ALSO