Use Durable RunsBeta
Use a durable run for long-running requests to keep a connection open until a run finishes. A durable run keeps working even if you close the browser, lose your connection, or a worker restarts. The service saves its progress at checkpoints as the run moves through the pipeline, so if anything interrupts the run, it resumes from the last checkpoint instead of starting over.
Prerequisites
- You must have a service with a published pipeline. For details, see Publish a Pipeline to a Service.
- You must have the same read permission as for ordinary deployment history, plus the search history read permission, to view the Runs tab, run deep links, and the Durable option in Connect.
- To cancel a run, you also need the services write permission.
- Durable runs must be turned on for your organization and supported by the service. If either is unavailable, the Runs tab, run deep links, and the Durable option in Connect are hidden.
Submit a Durable Run
Durable runs support synchronous pipelines without Agents.
- In Haystack Enterprise Platform, click Gateway in the navigation and open the service.
- Click Connect.
- Under Try a durable run, switch the response mode to Durable.
- Edit the request body if needed, then click Start run.
To submit from your own tooling instead, use the Submit with cURL example. Set HAYSTACK_API_KEY to a workspace API key, which is sent as a Bearer token. Before each new run, set DURABLE_IDEMPOTENCY_KEY to a unique value. When you retry a request, reuse the same key and the identical JSON body so the service doesn't start a duplicate run.
View Durable Runs
- Open the service and click Runs.
- Find your run in the Active list, which shows runs that are submitting, queued, running, or waiting, or in the History list, which shows finished runs and rejected submissions.
- Click Load older at the bottom of a list to see more runs, or Refresh to reload it.
- Click a run's query to open its details. To go back to the list, click All runs.
If the platform can't reach the runtime, the run is marked Stale and the page shows the last observed state until the next successful update.
Cancel a Run
- Open the detail page of a run that's still active.
- Click Cancel run, then confirm in the dialog. To keep the run going, click Keep running.
Once a run reaches a terminal state, canceling is no longer available.
What To Do Next
- Monitor and Debug a Service to read the trace of a run.
- Connect to a Published Service for other ways to call the service.
Related Information
Was this page helpful?