Is it possible to use the Rust SDK to add a starter to my application? I have a Go application and a Rust application but I would like to start the workflow on the go app from the rust end.
How would I go about doing this. Are there any examples on how to do this with the temporal-rust sdk?
You don’t need Temporal SDK to create a starter. Temporal service exposes gRPC interface. So you can generate your own gRPC client and use it to start workflows.
tonic::include_proto!("temporal.api.workflowservice.v1"); // The string specified here must match the proto package name
pub(crate) const FILE_DESCRIPTOR_SET: &'static [u8] =
tonic::include_file_descriptor_set!("service_descriptor");
However it cannot be built and there are over 150 errors of different kinds e.g
415 | #[derive(Clone, PartialEq, ::prost::Message)]
| ^^^^^^^^^^^^^^^^ cannot infer type
|
= note: cannot satisfy `_: Default`
= note: required by `std::default::Default::default`
= note: this error originates in the derive macro `::prost::Message` (in Nightly builds, run with -Z macro-backtrace for more info)
While it can be called by a grpc call it isn’t as simple due to static typing as required by rust. Hence why I was asking if there was a way to interface with the sdk to call to start workflow
Your particular question is really just about using prost_build it looks like. I think you just may not be depending on prost_types which is why you are missing a Default implementation for something. Your error paste isn’t quite long enough for me to see what, though.
That said there is a fairly easy solution to your problem. The Rust Core has a crate specifically for just the protobuf generated stuff, located here: sdk-core/sdk-core-protos at 30f288e18f26443abc9ecf2da253f22eaf28b056 · temporalio/sdk-core · GitHub – I’m not regularly publishing it to crates.io right now and it’s not explicitly ready for public consumption but it should work just fine if all you need is a client. You can depend on it in your crate via a git path. Give that a shot and let me know how it goes.
It depends on proto files that are above it in the directory structure which might cause issues with depending on it via git path in cargo. If that’s the case, you might want to just pull down the entire sdk-core repo and depend on just the protos crate via path.
How do I make it execute and return immediately (vs waiting for temporal to finish the workflow)
How do I get the result of the workflow? The above response only contains a run id, and also if I’m not waiting for the grpc call to return how would I check?
This is what i’ve tried but I don’t seem to get anything useful:
How do I make it execute and return immediately (vs waiting for temporal to finish the workflow)
This is what start_workflow_execution does, so that should already be the case with what you’ve written.
How do I get the result of the workflow? The above response only contains a run id, and also if I’m not waiting for the grpc call to return how would I check?