Long-running operations pattern
The long-running operations pattern is an API interaction pattern in which work continues asynchronously after the initial request and is completed through later status checks or notifications.
API Design Patterns
The long-running operations pattern is an API structure for representing work that continues after the initial request and exposing its status or result asynchronously.
- How it is used
- Structures asynchronous import and export work so consumers can track progress and receive a later result or error.
- How deep it goes
- Defines a generic operation interface and progress metadata, but stops short of detailing every operational mechanism.
- Examples
- Demonstrates exporting messages to hosted files or Amazon S3 with optional Gzip compression and encryption.
- What you can do after
- Apply it by modeling asynchronous API responses with operation identifiers, completion state, typed results, errors, and progress metadata.
Read how API Design Patterns explains long-running operations pattern →
The Design of Web APIs, Second Edition
A long operation is an API interaction pattern in which work that exceeds normal request latency is initiated asynchronously and completed through later status checking or notification.
- How it is used
- Handles API work that may last minutes or hours without tying up a request connection.
- How deep it goes
- Explains asynchronous initiation, status monitoring, polling optimization, callbacks, and Prefer-based execution choices.
- Examples
- Uses video analysis and on-demand stock market simulations to demonstrate job creation, status checks, and result retrieval.
- What you can do after
- Apply it by starting jobs, returning 202 Accepted and Location, monitoring status, and retrieving results without long-lived requests.
Read how The Design of Web APIs, Second Edition explains long-running operations pattern →
Related concepts
- pollinguses · Polling is the repeated checking or querying of a resource, system, or condition, often at intervals, to detect data, events, or state changes.
- import/export patternused by · The import/export pattern is a reusable API structure for transferring substantial amounts of data into or out of a service while accommodating destinations, transformations, and asynchronous processing.
- callbackused by · A callback is a function or other callable supplied to software for invocation later in response to a specified event, condition, or point in execution.
- workflow jobuses · A workflow job is an executable unit of work that groups tasks or steps with the logic and requirements needed to run them.
- Prefer headerconfigured by · The Prefer header is an HTTP request header field that lets a client communicate preferences about how a server should process a request.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

