Skip to main content

Update

Updates are defined as Protobuf RPCs annotated with the temporal.v1.update method option. They're mapped to workflows using the update workflow option. See the Updates guide for more usage details.

warning

Updates are considered experimental. They can be enabled using the workflow-update-enabled plugin option. They are disabled by default.

info

Update definitions can omit an input and/or out parameter by specifying the native google.protobuf.Empty message type in its place. This requires an additional google/protobuf/empty.proto protobuf import.

example.proto
syntax="proto3";

package example.v1;

import "temporal/v1/temporal.proto";

service Example {
// Hello returns a friendly greeting
rpc Hello(HelloInput) returns (HelloOutput) {
option (temporal.v1.workflow) = {
update: { ref: 'UpdateHello' }
};
}

// UpdateHello updates an existing Hello workflow
rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {
option (temporal.v1.update) = {};
}
}

Options

id

string

Specifies the default Update ID as a Bloblang expression.

service Example {
rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {
option (temporal.v1.update) = {
id: 'update-hello/${! newName }'
};
}
}

message UpdateHelloInput {
string new_name = 1;
}

name

string

Fully qualified Update type name. Defaults to protobuf method full name (e.g. example.v1.Example.UpdateHello)

service Example {
rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {
option (temporal.v1.update) = {
name: "UpdateHello"
};
}
}

patches

[]temporal.v1.Patch

Controls how a particular Patch is implemented in generated code, overriding any plugin or service-level configuration.

service Example {
option (temporal.v1.service) = {
patches: [
{ version: PV_64, mode: PV_MARKER },
]
};

rpc Example(ExampleInput) returns (ExampleOutput) {
option (temporal.v1.update) = {
patches: [
{ version: PV_64, mode: PV_ENABLED }
]
}
}
}

validate

bool

Enables update validation.

service Example {
rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {
option (temporal.v1.update) = {
validate: true
};
}
}

xns

temporal.v1.XNSActivityOptions

Used to configure cross-namespace activity options.

note

This requires the enable-xns plugin option to be enabled.

service Example {
rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {
option (temporal.v1.update) = {
xns: {
heartbeat_timeout: { seconds: 30 }
heartbeat_interval: { seconds: 10 }
start_to_close_timeout: { seconds: 300 }
}
};
}
}

wait_policy

temporal.v1.WaitPolicy

Used to indicate to the server how long the client wishes to wait for a return value from an UpdateWorkflow RPC.

service Example {
rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {
option (temporal.v1.update) = {
wait_policy: WAIT_POLICY_COMPLETED
};
}
}