Skip to main content

Class: InitializeWorkflow

Initialize a new workflow

Properties​

arguments​

arguments: $Properties[]

Inputs to the workflow code


attempt​

attempt: number

Starting at 1, the number of times we have tried to execute this workflow


continuedFailure?​

optional continuedFailure?: $Properties | null

If this workflow was a continuation and that continuation failed, the details of that.


continuedFromExecutionRunId​

continuedFromExecutionRunId: string

Run id of the previous workflow which continued-as-new or retired or cron executed into this workflow, if any.


continuedInitiator​

continuedInitiator: ContinueAsNewInitiator

If this workflow was a continuation, indicates the type of continuation.


cronSchedule​

cronSchedule: string

If this workflow runs on a cron schedule, it will appear here


cronScheduleToScheduleInterval?​

optional cronScheduleToScheduleInterval?: $Properties | null

For a cron workflow, this contains the amount of time between when this iteration of the cron workflow was scheduled and when it should run next per its cron_schedule.


firstExecutionRunId​

firstExecutionRunId: string

This is the very first run id the workflow ever had, following continuation chains.


headers​

headers: object

Used to add metadata e.g. for tracing and auth, meant to be read and written to by interceptors.

Index Signature​

[k: string]: $Properties


identity​

identity: string

Identity of the client who requested this execution


lastCompletionResult?​

optional lastCompletionResult?: $Properties | null

If this workflow was a continuation and that continuation completed, the details of that.


memo?​

optional memo?: $Properties | null

User-defined memo


originalExecutionRunId​

originalExecutionRunId: string

The run id recorded on the WORKFLOW_EXECUTION_STARTED event. Unlike the execution's current run id, this value is preserved across workflow resets. Mirrors the original_execution_run_id field from WorkflowExecutionStartedEventAttributes.


parentWorkflowInfo?​

optional parentWorkflowInfo?: $Properties | null

If this workflow is a child, information about the parent


priority?​

optional priority?: $Properties | null

Priority of this workflow execution


propagatedNexusSerializationContext?​

optional propagatedNexusSerializationContext?: $Properties | null

Serialization context of the Nexus operation handler that started this workflow, if any. Lang should use it to serialize the workflow's result and failure, which are returned to the Nexus caller.


randomnessSeed​

randomnessSeed: Long

The seed must be used to initialize the random generator used by SDK. RandomSeedUpdatedAttributes are used to deliver seed updates.


retryPolicy?​

optional retryPolicy?: $Properties | null

This workflow's retry policy


rootWorkflow?​

optional rootWorkflow?: $Properties | null

Contains information about the root workflow execution. It is possible for the namespace to be different than this workflow if using OSS and cross-namespace children, but this information is not retained. Users should take care to track it by other means in such situations.

The root workflow execution is defined as follows:

  1. A workflow without parent workflow is its own root workflow.
  2. A workflow that has a parent workflow has the same root workflow as its parent workflow.

See field in WorkflowExecutionStarted for more detail.


searchAttributes?​

optional searchAttributes?: $Properties | null

Search attributes created/updated when this workflow was started


startTime?​

optional startTime?: $Properties | null

When the workflow execution started event was first written


workflowExecutionExpirationTime?​

optional workflowExecutionExpirationTime?: $Properties | null

The absolute time at which the workflow will be timed out. This is passed without change to the next run/retry of a workflow.


workflowExecutionTimeout?​

optional workflowExecutionTimeout?: $Properties | null

Total workflow execution timeout including retries and continue as new.


workflowId​

workflowId: string

The workflow id used on the temporal server


workflowRunTimeout?​

optional workflowRunTimeout?: $Properties | null

Timeout of a single workflow run.


workflowTaskTimeout?​

optional workflowTaskTimeout?: $Properties | null

Timeout of a single workflow task.


workflowType​

workflowType: string

The identifier the lang-specific sdk uses to execute workflow code

Methods​

toJSON()​

toJSON(): object

Converts this InitializeWorkflow to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): InitializeWorkflow & $Shape

Creates a new InitializeWorkflow instance using the specified properties.

Parameters​
properties?​

$Shape

Properties to set

Returns​

InitializeWorkflow & $Shape

InitializeWorkflow instance

Call Signature​

static create(properties?): InitializeWorkflow

Creates a new InitializeWorkflow instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

InitializeWorkflow

InitializeWorkflow instance


decode()​

static decode(reader, length?): InitializeWorkflow & $Shape

Decodes an InitializeWorkflow message from the specified reader or buffer.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

length?​

number

Message length if known beforehand

Returns​

InitializeWorkflow & $Shape

InitializeWorkflow

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): InitializeWorkflow & $Shape

Decodes an InitializeWorkflow message from the specified reader or buffer, length delimited.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

InitializeWorkflow & $Shape

InitializeWorkflow

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


encode()​

static encode(message, writer?): Writer

Encodes the specified InitializeWorkflow message. Does not implicitly coresdk.workflow_activation.InitializeWorkflow.verify|verify messages.

Parameters​

message​

$Properties

InitializeWorkflow message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

Encodes the specified InitializeWorkflow message, length delimited. Does not implicitly coresdk.workflow_activation.InitializeWorkflow.verify|verify messages.

Parameters​

message​

$Properties

InitializeWorkflow message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): InitializeWorkflow

Creates an InitializeWorkflow message from a plain object. Also converts values to their respective internal types.

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

InitializeWorkflow

InitializeWorkflow


toObject()​

static toObject(message, options?): object

Creates a plain object from an InitializeWorkflow message. Also converts values to other types if specified.

Parameters​

message​

InitializeWorkflow

InitializeWorkflow

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object