Skip to main content

CloneForkFlowRequest

Struct CloneForkFlowRequest 

Source
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: String

Required. Flow ID of the source run.

§source_run_id: String

Run 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: String

Required. 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: String

Required. 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: i32

Decides 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: i32

Flow 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: String

Free text that explains the clone fork, recorded with the new run’s start.

§point_type: i32

Selects the copied point. UNSPECIFIED selects CURRENT.

§history_event_time: String

RFC 3339 time for FLOW_CLONE_FORK_POINT_TYPE_HISTORY_EVENT_TIME, as ResetFlowRequest.history_event_time.

§step_type: String

Step type for FLOW_CLONE_FORK_POINT_TYPE_STEP_TYPE.

§step_execution_id: String

Step execution ID for FLOW_CLONE_FORK_POINT_TYPE_STEP_EXECUTION_ID.

§step_method: i32

Step 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: i64

FlowHistoryEvent.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: i32

Selects 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: i32

Decides 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

Source

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.

Source

pub fn set_id_reuse_policy(&mut self, value: IdReusePolicy)

Sets id_reuse_policy to the provided enum value.

Source

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.

Source

pub fn set_point_type(&mut self, value: FlowCloneForkPointType)

Sets point_type to the provided enum value.

Source

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.

Source

pub fn set_step_method(&mut self, value: FlowResetStepMethod)

Sets step_method to the provided enum value.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CloneForkFlowRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CloneForkFlowRequest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for CloneForkFlowRequest

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for CloneForkFlowRequest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CloneForkFlowRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more