Waiting to be resumed
{#if description != undefined}
{/if}
{#if isOwner || resumeUrl}
{
if (resumeUrl) {
let split = resumeUrl.split('/')
let signatureUrl = split.pop() ?? ''
const regex = /([^?]+)(?:\?[^=]+=(\w+))?/
const matches = signatureUrl.match(regex)
const signature = matches?.[1]
if (!signature) {
sendUserToast(`Could not parse signature: ${signatureUrl}`, true)
return
}
const approver = matches?.[2] || undefined
let resumeId = -1
let parsedResumeId = split.pop() ?? ''
try {
resumeId = new Number(parsedResumeId).valueOf()
} catch (e) {
console.error(`Could not parse resume id: ${parsedResumeId}`)
}
let jobId = split.pop() ?? ''
await JobService.resumeSuspendedJobPost({
workspace: workspaceId ?? $workspaceStore ?? '',
id: jobId,
requestBody: default_payload,
resumeId,
signature,
approver
})
} else {
await JobService.resumeSuspendedFlowAsOwner({
workspace: workspaceId ?? $workspaceStore ?? '',
id: job?.id ?? '',
requestBody: default_payload
})
}
}}
>Resume Since you are an owner of this flow, you can send resume events without necessarily
knowing the resume id sent by the approval step
{#if job?.raw_flow?.modules?.[approvalStep]?.suspend?.resume_form?.schema}
{/if}
The payload is optional, it is passed to the following step through the `resume` variable
{:else}
You cannot resume the flow yourself without receiving the resume secret since you are not an
owner of {job.script_path} and the approval step did not contain the resume url at key `resume`
{/if}