A stateful function is a serverless compute primitive, central to frameworks like Apache Flink, that can maintain and manipulate fault-tolerant local state across multiple, potentially concurrent, invocations. Unlike traditional stateless serverless functions, it preserves context between calls, allowing it to manage session data, aggregate streams, or implement stateful workflows and finite state machines (FSMs). This model is essential for building stateful agents and complex event processing pipelines where continuity is required.
