Package io.temporal.workflow
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getAttempt()
java.util.Optional<java.lang.String>
getContinuedExecutionRunId()
java.lang.String
getCronSchedule()
java.lang.String
getFirstExecutionRunId()
long
getHistoryLength()
java.lang.String
getNamespace()
java.util.Optional<java.lang.String>
getOriginalExecutionRunId()
Note: This value is NOT preserved by continue-as-new, retries or cron Runs.java.util.Optional<java.lang.String>
getParentRunId()
java.util.Optional<java.lang.String>
getParentWorkflowId()
java.lang.String
getRunId()
Note: RunId is unique identifier of one workflow code execution.long
getRunStartedTimestampMillis()
The time workflow run has started.io.temporal.api.common.v1.SearchAttributes
getSearchAttributes()
This method is used to get raw proto serialized Search Attributes.java.lang.String
getTaskQueue()
java.time.Duration
getWorkflowExecutionTimeout()
java.lang.String
getWorkflowId()
java.time.Duration
getWorkflowRunTimeout()
java.lang.String
getWorkflowType()
-
-
-
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
-
getRunId
java.lang.String getRunId()
Note: RunId is unique identifier of one workflow code execution. Reset changes RunId.- Returns:
- Workflow Run ID that is handled by the current workflow code execution.
- See Also:
for RunId variation that is resistant to Resets
,for the very first RunId that is preserved along the whole Workflow Execution chain, including ContinueAsNew, Retry, Cron and Reset.
-
getFirstExecutionRunId
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.
-
getOriginalExecutionRunId
java.util.Optional<java.lang.String> getOriginalExecutionRunId()
Note: This value is NOT preserved by continue-as-new, retries or cron Runs. They are separate Runs of one Workflow Execution Chain.- Returns:
- original RunId of the current Workflow Run. This value is preserved during Reset which changes RunID.
- See Also:
for the very first RunId that is preserved along the whole Workflow Execution chain, including ContinueAsNew, Retry, Cron and Reset.
-
getTaskQueue
java.lang.String getTaskQueue()
- Returns:
- Workflow Task Queue name
-
getWorkflowRunTimeout
java.time.Duration getWorkflowRunTimeout()
- Returns:
- Timeout for a Workflow Run specified during Workflow start in
WorkflowOptions.Builder.setWorkflowRunTimeout(Duration)
-
getWorkflowExecutionTimeout
java.time.Duration getWorkflowExecutionTimeout()
- Returns:
- Timeout for the Workflow Execution specified during Workflow start in
WorkflowOptions.Builder.setWorkflowExecutionTimeout(Duration)
-
getRunStartedTimestampMillis
long getRunStartedTimestampMillis()
The time workflow run has started. Note that this time can be different from the time workflow function started actual execution.
-
getSearchAttributes
@Nullable io.temporal.api.common.v1.SearchAttributes getSearchAttributes()
This method is used to get raw proto serialized Search Attributes.Consider using more user-friendly methods on
Workflow
class, includingWorkflow.getSearchAttributes()
,Workflow.getSearchAttribute(String)
orWorkflow.getSearchAttributeValues(String)
instead of this method to access deserialized search attributes.- Returns:
- raw Search Attributes Protobuf entity, null if empty
-
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
-
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...)
.
-
-