Skip to content

Restart invocation #3347

Open
Open
@slinkydeveloper

Description

@slinkydeveloper

This is gonna be the command:

/// Restart an invocation.
///
/// This will restart the invocation, given its input is available.
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct RestartInvocationRequest {
    pub invocation_id: InvocationId,

    // What to do if the invocation is still running.
    pub if_running: IfRunning,

    /// If set, it will override the configured completion_retention/journal_retention when the invocation was executed the first time.
    /// If none of the completion_retention/journal_retention are configured, and neither this previous_attempt_retention, then the previous attempt won't be retained at all.
    ///
    /// To retain the previous attempt, the new attempt will take the invocation id of the previous attempt (the one used to trigger this reset),
    /// and the old invocation id will take a new randomly generated invocation id.
    pub previous_attempt_retention: Option<Duration>,

    /// What to do in case the invocation was a Workflow run (workflow service and workflow handler type)
    pub apply_to_workflow_run: ApplyToWorkflowRun,
}

#[derive(Default, Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum IfRunning {
    /// Kill the invocation, then restart it.
    #[default]
    Kill,
    /// Fail the Restart command if the invocation is still running
    Fail,
}

#[derive(Default, Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum ApplyToWorkflowRun {
    Nothing,
    ClearOnlyPromises,
    ClearOnlyState,
    #[default]
    ClearAllPromisesAndState
}

Metadata

Metadata

Labels

ops-exRestate operational experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions