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.
Signals definitions must use google.protobuf.Empty
as their return value. This requires an additional google/protobuf/empty.proto
protobuf import.
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
cli.aliases
[]string
Adds additional aliases to the CLI command.
service Example {
rpc Ping(PingInput) returns (google.protobuf.Empty) {
option (temporal.v1.signal) = {
cli: {aliases: ["p"]}
};
}
}
cli.ignore
bool
Prevents the generation of CLI commands for the signal.
service Example {
rpc Ping(PingInput) returns (google.protobuf.Empty) {
option (temporal.v1.signal) = {
cli: {ignore: true}
};
}
}
cli.name
string
Overrides the default CLI command name for the signal.
service Example {
rpc Ping(PingInput) returns (google.protobuf.Empty) {
option (temporal.v1.signal) = {
cli: {name: "do-ping"}
};
}
}
cli.usage
string
Overrides the default CLI command usage for the signal.
service Example {
rpc Ping(PingInput) returns (google.protobuf.Empty) {
option (temporal.v1.signal) = {
cli: {usage: "send a ping"}
};
}
}
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.
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 }
}
};
}
}