Signal
Signals are defined as Protobuf RPCs annotated with the temporal.v1.signal
method option. They're mapped to workflows using the signal workflow option. See the Signals guide for more usage details.
warning
Signals definitions must use google.protobuf.Empty
as their return value. This requires an additional google/protobuf/empty.proto
protobuf import.
example.proto
syntax="proto3";
package example.v1;
import "google/protobuf/empty.proto";
import "temporal/v1/temporal.proto";
service Example {
// Hello returns a friendly greeting
rpc Hello(HelloInput) returns (HelloOutput) {
option (temporal.v1.workflow) = {
signal: { ref: 'Ping' }
};
}
// Ping sends a signal to an existing workflow
rpc Ping(PingInput) returns (google.protobuf.Empty) {
option (temporal.v1.signal) = {};
}
}
Options
name
string
Fully qualified Signal type name. Defaults to protobuf method full name (e.g. example.v1.Example.Ping
)
service Example {
rpc Ping(PingInput) returns (google.protobuf.Empty) {
option (temporal.v1.signal) = {
name: "Ping"
};
}
}
patches
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.signal) = {
patches: [
{ version: PV_64, mode: PV_ENABLED }
]
}
}
}
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 Ping(PingInput) returns (google.protobuf.Empty) {
option (temporal.v1.signal) = {
xns: {
heartbeat_timeout: { seconds: 30 }
heartbeat_interval: { seconds: 10 }
start_to_close_timeout: { seconds: 300 }
}
};
}
}