Skip to content

Checkpoint Durable Execution

lambda_checkpoint_durable_execution R Documentation

Saves the progress of a durable function execution during runtime

Description

Saves the progress of a durable function execution during runtime. This API is used by the Lambda durable functions SDK to checkpoint completed steps and schedule asynchronous operations. You typically don't need to call this API directly as the SDK handles checkpointing automatically.

Each checkpoint operation consumes the current checkpoint token and returns a new one for the next checkpoint. This ensures that checkpoints are applied in the correct order and prevents duplicate or out-of-order state updates.

Usage

lambda_checkpoint_durable_execution(DurableExecutionArn,
  CheckpointToken, Updates, ClientToken)

Arguments

DurableExecutionArn

[required] The Amazon Resource Name (ARN) of the durable execution.

CheckpointToken

[required] A unique token that identifies the current checkpoint state. This token is provided by the Lambda runtime and must be used to ensure checkpoints are applied in the correct order. Each checkpoint operation consumes this token and returns a new one.

Updates

An array of state updates to apply during this checkpoint. Each update represents a change to the execution state, such as completing a step, starting a callback, or scheduling a timer. Updates are applied atomically as part of the checkpoint operation.

ClientToken

An optional idempotency token to ensure that duplicate checkpoint requests are handled correctly. If provided, Lambda uses this token to detect and handle duplicate requests within a 15-minute window.

Value

A list with the following syntax:

list(
  CheckpointToken = "string",
  NewExecutionState = list(
    Operations = list(
      list(
        Id = "string",
        ParentId = "string",
        Name = "string",
        Type = "EXECUTION"|"CONTEXT"|"STEP"|"WAIT"|"CALLBACK"|"CHAINED_INVOKE",
        SubType = "string",
        StartTimestamp = as.POSIXct(
          "2015-01-01"
        ),
        EndTimestamp = as.POSIXct(
          "2015-01-01"
        ),
        Status = "STARTED"|"PENDING"|"READY"|"SUCCEEDED"|"FAILED"|"CANCELLED"|"TIMED_OUT"|"STOPPED",
        ExecutionDetails = list(
          InputPayload = "string"
        ),
        ContextDetails = list(
          ReplayChildren = TRUE|FALSE,
          Result = "string",
          Error = list(
            ErrorMessage = "string",
            ErrorType = "string",
            ErrorData = "string",
            StackTrace = list(
              "string"
            )
          )
        ),
        StepDetails = list(
          Attempt = 123,
          NextAttemptTimestamp = as.POSIXct(
            "2015-01-01"
          ),
          Result = "string",
          Error = list(
            ErrorMessage = "string",
            ErrorType = "string",
            ErrorData = "string",
            StackTrace = list(
              "string"
            )
          )
        ),
        WaitDetails = list(
          ScheduledEndTimestamp = as.POSIXct(
            "2015-01-01"
          )
        ),
        CallbackDetails = list(
          CallbackId = "string",
          Result = "string",
          Error = list(
            ErrorMessage = "string",
            ErrorType = "string",
            ErrorData = "string",
            StackTrace = list(
              "string"
            )
          )
        ),
        ChainedInvokeDetails = list(
          Result = "string",
          Error = list(
            ErrorMessage = "string",
            ErrorType = "string",
            ErrorData = "string",
            StackTrace = list(
              "string"
            )
          )
        )
      )
    ),
    NextMarker = "string"
  )
)

Request syntax

svc$checkpoint_durable_execution(
  DurableExecutionArn = "string",
  CheckpointToken = "string",
  Updates = list(
    list(
      Id = "string",
      ParentId = "string",
      Name = "string",
      Type = "EXECUTION"|"CONTEXT"|"STEP"|"WAIT"|"CALLBACK"|"CHAINED_INVOKE",
      SubType = "string",
      Action = "START"|"SUCCEED"|"FAIL"|"RETRY"|"CANCEL",
      Payload = "string",
      Error = list(
        ErrorMessage = "string",
        ErrorType = "string",
        ErrorData = "string",
        StackTrace = list(
          "string"
        )
      ),
      ContextOptions = list(
        ReplayChildren = TRUE|FALSE
      ),
      StepOptions = list(
        NextAttemptDelaySeconds = 123
      ),
      WaitOptions = list(
        WaitSeconds = 123
      ),
      CallbackOptions = list(
        TimeoutSeconds = 123,
        HeartbeatTimeoutSeconds = 123
      ),
      ChainedInvokeOptions = list(
        FunctionName = "string",
        TenantId = "string"
      )
    )
  ),
  ClientToken = "string"
)