Interface WorkflowInfo


  • public interface WorkflowInfo
    Provides information about the current Workflow Execution and Run. Also provides access to immutable information about connected entities like Parent Workflow Execution or a previous Run.
    • Method Detail

      • getNamespace

        java.lang.String getNamespace()
        Returns:
        Workflow Namespace
      • getWorkflowId

        java.lang.String getWorkflowId()
        Returns:
        Workflow ID
      • getWorkflowType

        java.lang.String getWorkflowType()
        Returns:
        Workflow Type
      • getFirstExecutionRunId

        @Nonnull
        java.lang.String getFirstExecutionRunId()
        Returns:
        The very first original RunId of the current Workflow Execution preserved along the chain of ContinueAsNew, Retry, Cron and Reset. Identifies the whole Runs chain of Workflow Execution.
      • getContinuedExecutionRunId

        java.util.Optional<java.lang.String> getContinuedExecutionRunId()
        Returns:
        Run ID of the previous Workflow Run which continued-as-new or retried or cron-scheduled into the current Workflow Run.
      • getTaskQueue

        java.lang.String getTaskQueue()
        Returns:
        Workflow Task Queue name
      • getRunStartedTimestampMillis

        long getRunStartedTimestampMillis()
        The time workflow run has started. Note that this time can be different from the time workflow function started actual execution.
      • getParentWorkflowId

        java.util.Optional<java.lang.String> getParentWorkflowId()
        Returns:
        Workflow ID of the parent Workflow
      • getParentRunId

        java.util.Optional<java.lang.String> getParentRunId()
        Returns:
        Run ID of the parent Workflow
      • getRootWorkflowId

        java.util.Optional<java.lang.String> getRootWorkflowId()
        Returns:
        Workflow ID of the root Workflow
      • getRootRunId

        java.util.Optional<java.lang.String> getRootRunId()
        Returns:
        Run ID of the root Workflow
      • getAttempt

        int getAttempt()
        Returns:
        Workflow retry attempt handled by this Workflow code execution. Starts on "1".
      • getCronSchedule

        java.lang.String getCronSchedule()
        Returns:
        Workflow cron schedule
      • getHistoryLength

        long getHistoryLength()
        Returns:
        length of Workflow history up until the current moment of execution. This value changes during the lifetime of a Workflow Execution. You may use this information to decide when to call Workflow.continueAsNew(Object...).
      • getHistorySize

        long getHistorySize()
        Returns:
        size of Workflow history in bytes up until the current moment of execution. This value changes during the lifetime of a Workflow Execution.
      • isContinueAsNewSuggested

        boolean isContinueAsNewSuggested()
        Returns:
        true if the server is configured to suggest continue as new and it is suggested. This value changes during the lifetime of a Workflow Execution.
      • getCurrentBuildId

        java.util.Optional<java.lang.String> getCurrentBuildId()
        Returns:
        The Build ID of the worker which executed the current Workflow Task. May be empty the task was completed by a worker without a Build ID. If this worker is the one executing this task for the first time and has a Build ID set, then its ID will be used. This value may change over the lifetime of the workflow run, but is deterministic and safe to use for branching.
      • getPriority

        @Nonnull
        Priority getPriority()
        Return the priority of the workflow task.