pub struct CloneForkFlowRequest {Show 18 fields
pub source_flow_id: String,
pub source_run_id: String,
pub flow_id: String,
pub request_id: String,
pub id_reuse_policy: i32,
pub flow_already_started_options: Option<FlowAlreadyStartedOptions>,
pub flow_config_override: Option<FlowConfig>,
pub attributes: Vec<AttributeWrite>,
pub flow_timeout_seconds: i32,
pub reason: String,
pub point_type: i32,
pub history_event_time: String,
pub step_type: String,
pub step_execution_id: String,
pub step_method: i32,
pub event_id: i64,
pub run_attempt: i32,
pub sub_flow_reset_policy: i32,
}Expand description
Creates a new Flow whose first run starts from a copy of another Flow run’s state.
The source run is the Flow run that source_flow_id and source_run_id name. CloneForkFlow copies the source run’s state at one point: its Attributes, pending Channel messages, Step executions and their counters, Step waits and timers, and the values they hold. The new run gets the new Flow ID flow_id and a new run ID. It starts at run attempt 1 and continues on its own from the copied state. The source run keeps running and never changes; CloneForkFlow writes nothing to it.
The new run copies no history: its history starts with one FlowStartedOrContinued event whose clone_fork_source names the copied point. A later ResetFlow of the new run to its BEGINNING returns to the copied state, so the new run keeps every copied value for its whole life. CloneForkFlow does not apply the source run’s input after the point, such as RPCs, Channel publications, or Attribute writes.
Steps that were running at the point start again in the new run: their method calls are dispatched again with the same attempt numbers, snapshots, and locks. Steps that waited at the point keep waiting, and their timers keep their original fire times. The new run does not copy Stream messages, RPC and Channel publication deduplication records, the parent of a child Flow, or the sticky Worker.
Requires Server protocol version 6 or later.
Fields§
§source_flow_id: StringRequired. Flow ID of the source run.
source_run_id: StringRun ID of the source run. Empty selects the latest run of source_flow_id. The source run may be closed, but the state at the selected point must be RUNNING.
flow_id: StringRequired. Flow ID of the new Flow. It must differ from source_flow_id; to return a Flow to an earlier point, use ResetFlow.
request_id: StringRequired. Identifies one logical CloneForkFlow; Dex records it as the new run’s start request ID. A request with the request ID of the latest run of flow_id is a retry: Dex copies nothing and never applies id_reuse_policy, and flow_already_started_options chooses the result, as for StartFlowRequest.request_id.
id_reuse_policy: i32Decides whether CloneForkFlow may start a run for a flow_id that already has a run, as for StartFlow. The decision and the new run commit together. ALLOW_TERMINATE_IF_RUNNING terminates a running latest run of flow_id in the same change.
flow_already_started_options: Option<FlowAlreadyStartedOptions>Chooses the result when Dex does not start a new run, as for StartFlow.
flow_config_override: Option<FlowConfig>Changes the copied FlowConfig of the source run, as FlowStartOptions.flow_config_override changes the server default. Unset fields keep the source run’s values. An empty worker_target.task_queue keeps the source run’s task queue. Set a task queue when Workers pick their Flows by task queue, so that the Workers of the source run do not run the new run’s Steps.
attributes: Vec<AttributeWrite>Attribute writes applied after the copy, in the same change that creates the new run. Validated as FlowStartOptions.attributes.
flow_timeout_seconds: i32Flow timeout of the new run in seconds, counted from CloneForkFlow. Zero keeps the source run’s Flow timeout duration, also counted from CloneForkFlow; a source run without a Flow timeout gives a new run without one. When the source run’s Flow timeout had already fired at the point, the new run keeps that outcome, such as a running timeout handler, and gets no Flow timeout. The Flow timeout policy and handler options are the source run’s; a source run without a policy uses FLOW_TIMEOUT_POLICY_FAIL. Must not be negative.
reason: StringFree text that explains the clone fork, recorded with the new run’s start.
point_type: i32Selects the copied point. UNSPECIFIED selects CURRENT.
history_event_time: StringRFC 3339 time for FLOW_CLONE_FORK_POINT_TYPE_HISTORY_EVENT_TIME, as ResetFlowRequest.history_event_time.
step_type: StringStep type for FLOW_CLONE_FORK_POINT_TYPE_STEP_TYPE.
step_execution_id: StringStep execution ID for FLOW_CLONE_FORK_POINT_TYPE_STEP_EXECUTION_ID.
step_method: i32Step method for FLOW_CLONE_FORK_POINT_TYPE_STEP_EXECUTION_ID; must be WAIT_FOR or EXECUTE for that type and unset for the others.
event_id: i64FlowHistoryEvent.event_id for FLOW_CLONE_FORK_POINT_TYPE_EVENT_ID; must be positive for that type. It follows the rules of ResetFlowRequest.event_id.
run_attempt: i32Selects the run attempt of the source run whose history holds the point, as ResetFlowRequest.run_attempt. Zero selects the current run attempt. CURRENT accepts only zero.
sub_flow_reset_policy: i32Decides what happens to the SubFlow conditions that copied Steps wait on. UNSPECIFIED means SUB_FLOW_RESET_POLICY_ATTACH_ELSE_RESTART.
The children of the source run report only to the source run. A child that ended attaches: its result completes the copied condition, read from the source run or from the child run. A child that still runs cannot be attached, so the policy’s second action applies. A restart starts a new child Flow whose Flow ID derives from flow_id, with the start the source run’s child received; the source run’s child never changes. A failure completes the condition with a FAILED result whose error type is FLOW_ERROR_TYPE_SUB_FLOW_ABANDONED and terminates nothing. A child whose run no longer exists can be neither attached nor restarted.
Implementations§
Source§impl CloneForkFlowRequest
impl CloneForkFlowRequest
Sourcepub fn id_reuse_policy(&self) -> IdReusePolicy
pub fn id_reuse_policy(&self) -> IdReusePolicy
Returns the enum value of id_reuse_policy, or the default if the field is set to an invalid enum value.
Sourcepub fn set_id_reuse_policy(&mut self, value: IdReusePolicy)
pub fn set_id_reuse_policy(&mut self, value: IdReusePolicy)
Sets id_reuse_policy to the provided enum value.
Sourcepub fn point_type(&self) -> FlowCloneForkPointType
pub fn point_type(&self) -> FlowCloneForkPointType
Returns the enum value of point_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_point_type(&mut self, value: FlowCloneForkPointType)
pub fn set_point_type(&mut self, value: FlowCloneForkPointType)
Sets point_type to the provided enum value.
Sourcepub fn step_method(&self) -> FlowResetStepMethod
pub fn step_method(&self) -> FlowResetStepMethod
Returns the enum value of step_method, or the default if the field is set to an invalid enum value.
Sourcepub fn set_step_method(&mut self, value: FlowResetStepMethod)
pub fn set_step_method(&mut self, value: FlowResetStepMethod)
Sets step_method to the provided enum value.
Sourcepub fn sub_flow_reset_policy(&self) -> SubFlowResetPolicy
pub fn sub_flow_reset_policy(&self) -> SubFlowResetPolicy
Returns the enum value of sub_flow_reset_policy, or the default if the field is set to an invalid enum value.
Sourcepub fn set_sub_flow_reset_policy(&mut self, value: SubFlowResetPolicy)
pub fn set_sub_flow_reset_policy(&mut self, value: SubFlowResetPolicy)
Sets sub_flow_reset_policy to the provided enum value.
Trait Implementations§
Source§impl Clone for CloneForkFlowRequest
impl Clone for CloneForkFlowRequest
Source§impl Debug for CloneForkFlowRequest
impl Debug for CloneForkFlowRequest
Source§impl Default for CloneForkFlowRequest
impl Default for CloneForkFlowRequest
Source§impl Message for CloneForkFlowRequest
impl Message for CloneForkFlowRequest
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for CloneForkFlowRequest
impl PartialEq for CloneForkFlowRequest
impl StructuralPartialEq for CloneForkFlowRequest
Auto Trait Implementations§
impl Forget for CloneForkFlowRequest
impl Freeze for CloneForkFlowRequest
impl Move for CloneForkFlowRequest
impl RefUnwindSafe for CloneForkFlowRequest
impl Send for CloneForkFlowRequest
impl Sync for CloneForkFlowRequest
impl Unpin for CloneForkFlowRequest
impl UnsafeUnpin for CloneForkFlowRequest
impl UnwindSafe for CloneForkFlowRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request