Skip to content

Commit cd2fead

Browse files
committed
Use the shared multi-language workflow service WIT verbatim
1 parent 7e02a64 commit cd2fead

6 files changed

Lines changed: 128 additions & 40 deletions

File tree

‎temporal-sdk/src/main/generated/io/temporal/workflow/SignalWithStartWorkflowRequest.java‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public final class SignalWithStartWorkflowRequest {
1313
*/
1414
private final java.util.List<Object> args;
1515
/**
16-
* Unique identifier for the workflow execution.
16+
* Unique identifier for the workflow execution. Must be nonempty.
1717
*/
1818
private final String id;
1919
/**
@@ -26,15 +26,16 @@ public final class SignalWithStartWorkflowRequest {
2626
*/
2727
private final java.util.List<Object> signalArgs;
2828
/**
29-
* Total workflow execution timeout, including retries and continue-as-new.
29+
* Total workflow execution timeout, including retries and continue-as-new. Defaults
30+
* to unlimited.
3031
*/
3132
private final java.time.Duration executionTimeout;
3233
/**
33-
* Timeout of a single workflow run.
34+
* Timeout of a single workflow run. Defaults to the workflow execution timeout.
3435
*/
3536
private final java.time.Duration runTimeout;
3637
/**
37-
* Timeout of a single workflow task.
38+
* Timeout of a single workflow task. Defaults to 10 seconds.
3839
*/
3940
private final java.time.Duration taskTimeout;
4041
/**
@@ -45,7 +46,7 @@ public final class SignalWithStartWorkflowRequest {
4546
/**
4647
* Behavior when a workflow is currently running with the same ID. Set to use-existing
4748
* for idempotent deduplication on workflow ID. Cannot be set if id-reuse-policy is
48-
* terminate-if-running.
49+
* terminate-if-running. Defaults to use-existing.
4950
*/
5051
private final io.temporal.api.enums.v1.WorkflowIdConflictPolicy idConflictPolicy;
5152
/**
@@ -78,8 +79,17 @@ public final class SignalWithStartWorkflowRequest {
7879
* cron-schedule.
7980
*/
8081
private final java.time.Duration startDelay;
82+
/**
83+
* Static metadata for the workflow execution.
84+
*/
8185
private final io.temporal.workflow.UserMetadata userMetadata;
86+
/**
87+
* Namespace of the workflow execution.
88+
*/
8289
private final String namespace;
90+
/**
91+
* Headers for the request.
92+
*/
8393
private final java.util.Map<String, io.temporal.api.common.v1.Payload> headers;
8494
@com.fasterxml.jackson.annotation.JsonCreator
8595
public SignalWithStartWorkflowRequest(@com.fasterxml.jackson.annotation.JsonProperty("workflow") String workflow, @com.fasterxml.jackson.annotation.JsonProperty("args") java.util.List<Object> args, @com.fasterxml.jackson.annotation.JsonProperty("id") String id, @com.fasterxml.jackson.annotation.JsonProperty("taskQueue") String taskQueue, @com.fasterxml.jackson.annotation.JsonProperty("signal") String signal, @com.fasterxml.jackson.annotation.JsonProperty("signalArgs") java.util.List<Object> signalArgs, @com.fasterxml.jackson.annotation.JsonProperty("executionTimeout") java.time.Duration executionTimeout, @com.fasterxml.jackson.annotation.JsonProperty("runTimeout") java.time.Duration runTimeout, @com.fasterxml.jackson.annotation.JsonProperty("taskTimeout") java.time.Duration taskTimeout, @com.fasterxml.jackson.annotation.JsonProperty("idReusePolicy") io.temporal.api.enums.v1.WorkflowIdReusePolicy idReusePolicy, @com.fasterxml.jackson.annotation.JsonProperty("idConflictPolicy") io.temporal.api.enums.v1.WorkflowIdConflictPolicy idConflictPolicy, @com.fasterxml.jackson.annotation.JsonProperty("retryPolicy") io.temporal.common.RetryOptions retryPolicy, @com.fasterxml.jackson.annotation.JsonProperty("cronSchedule") String cronSchedule, @com.fasterxml.jackson.annotation.JsonProperty("memo") java.util.Map<String, Object> memo, @com.fasterxml.jackson.annotation.JsonProperty("searchAttributes") io.temporal.common.SearchAttributes searchAttributes, @com.fasterxml.jackson.annotation.JsonProperty("priority") io.temporal.common.Priority priority, @com.fasterxml.jackson.annotation.JsonProperty("versioningOverride") io.temporal.common.VersioningOverride versioningOverride, @com.fasterxml.jackson.annotation.JsonProperty("startDelay") java.time.Duration startDelay, @com.fasterxml.jackson.annotation.JsonProperty("userMetadata") io.temporal.workflow.UserMetadata userMetadata, @com.fasterxml.jackson.annotation.JsonProperty("namespace") String namespace, @com.fasterxml.jackson.annotation.JsonProperty("headers") java.util.Map<String, io.temporal.api.common.v1.Payload> headers) {

‎temporal-sdk/src/main/generated/io/temporal/workflow/SignalWithStartWorkflowResponse.java‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
// Generated by nexgen v0.2.9. DO NOT EDIT!
22
package io.temporal.workflow;
33

4+
/**
5+
* Result of signaling a workflow and starting it if needed.
6+
*/
47
@io.temporal.common.converter.TransferTypeConvertible(SignalWithStartWorkflowResponse.Converter.class)
58
@SuppressWarnings({"unchecked", "rawtypes"})
69
public final class SignalWithStartWorkflowResponse {
10+
/**
11+
* Run ID of the started workflow.
12+
*/
713
private final String runId;
14+
/**
15+
* Whether the workflow was started.
16+
*/
817
private final Boolean started;
9-
private final String firstExecutionRunId;
1018
@com.fasterxml.jackson.annotation.JsonCreator
11-
public SignalWithStartWorkflowResponse(@com.fasterxml.jackson.annotation.JsonProperty("runId") String runId, @com.fasterxml.jackson.annotation.JsonProperty("started") Boolean started, @com.fasterxml.jackson.annotation.JsonProperty("firstExecutionRunId") String firstExecutionRunId) {
19+
public SignalWithStartWorkflowResponse(@com.fasterxml.jackson.annotation.JsonProperty("runId") String runId, @com.fasterxml.jackson.annotation.JsonProperty("started") Boolean started) {
1220
this.runId = runId;
1321
this.started = started;
14-
this.firstExecutionRunId = firstExecutionRunId;
1522
}
1623
public String getRunId() { return runId; }
1724
public Boolean getStarted() { return started; }
18-
public String getFirstExecutionRunId() { return firstExecutionRunId; }
1925
public Builder toBuilder() { return newBuilder(this); }
2026
public static Builder newBuilder(SignalWithStartWorkflowResponse value) { return new Builder(value); }
2127
public static Builder newBuilder() { return new Builder(); }
@@ -25,28 +31,23 @@ private Builder(SignalWithStartWorkflowResponse value) {
2531
if (value == null) return;
2632
this.runId = value.runId;
2733
this.started = value.started;
28-
this.firstExecutionRunId = value.firstExecutionRunId;
2934
}
3035
private String runId = null;
3136
public Builder setRunId(String value) { this.runId = value; return this; }
3237
private Boolean started = null;
3338
public Builder setStarted(Boolean value) { this.started = value; return this; }
34-
private String firstExecutionRunId = "";
35-
public Builder setFirstExecutionRunId(String value) { this.firstExecutionRunId = value; return this; }
36-
public SignalWithStartWorkflowResponse build() { return new SignalWithStartWorkflowResponse(runId, started, firstExecutionRunId); }
39+
public SignalWithStartWorkflowResponse build() { return new SignalWithStartWorkflowResponse(runId, started); }
3740
}
3841
public io.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse toProto(io.temporal.common.converter.DataConverter converter) {
3942
io.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse.Builder proto = io.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse.newBuilder();
4043
if (this.runId != null) io.temporal.workflow.NexgenRuntime.set(proto, "run_id", (this.runId));
4144
if (this.started != null) io.temporal.workflow.NexgenRuntime.set(proto, "started", (this.started));
42-
if (this.firstExecutionRunId != null) io.temporal.workflow.NexgenRuntime.set(proto, "first_execution_run_id", (this.firstExecutionRunId));
4345
return proto.build();
4446
}
4547
public static SignalWithStartWorkflowResponse fromProto(io.temporal.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse proto, io.temporal.common.converter.DataConverter converter, java.lang.reflect.Type modelType) {
4648
Builder builder = SignalWithStartWorkflowResponse.newBuilder();
4749
if (true) builder.setRunId((String) io.temporal.workflow.NexgenRuntime.get(proto, "run_id"));
4850
if (true) builder.setStarted((Boolean) io.temporal.workflow.NexgenRuntime.get(proto, "started"));
49-
if (true) builder.setFirstExecutionRunId((String) io.temporal.workflow.NexgenRuntime.get(proto, "first_execution_run_id"));
5051
return builder.build();
5152
}
5253
public static final class Converter implements io.temporal.common.converter.TransferTypeConverter<SignalWithStartWorkflowResponse> {

‎temporal-sdk/src/main/generated/io/temporal/workflow/UserMetadata.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Generated by nexgen v0.2.9. DO NOT EDIT!
22
package io.temporal.workflow;
33

4+
/**
5+
* Static metadata for a workflow execution.
6+
*/
47
@io.temporal.common.converter.TransferTypeConvertible(UserMetadata.Converter.class)
58
@SuppressWarnings({"unchecked", "rawtypes"})
69
public final class UserMetadata {

‎temporal-sdk/src/main/nexus/README.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# System Nexus bindings
22

3-
The WIT definitions here describe the workflow-facing Java models for the
4-
vendored workflow service. They retain the upstream wire schema and add Java
5-
native type and serialization context annotations. Protobuf descriptors from
3+
The WIT definitions here are a temporary copy of the shared multi-language
4+
definitions in nex-gen's `advanced/samples/inputs/workflow-service.wit` and
5+
`deps/nexus-temporal-types/model.wit`. Keep the copies identical; Java directives
6+
belong in the shared source alongside the other languages. The SDK will
7+
eventually consume these definitions from the API repo instead. Protobuf
8+
descriptors from
69
`temporal-serviceclient:generateProto` validate the mappings during generation.
710

811
Regenerate with nex-gen 0.2.9 built with its `advanced` feature:

‎temporal-sdk/src/main/nexus/deps/nexus-temporal-types/model.wit‎

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,48 @@ interface model {
99
/// java="Object"
1010
/// python="typing.Any"
1111
/// typescript="common.Payload"
12+
/// go="any"
1213
/// dotnet="object?"
14+
/// dotnet-from="ProtoExtensions.FromPayload"
1315
/// dotnet-to="ProtoExtensions.ToPayload"
1416
/// typescript-import="@temporalio/common"
1517
type payload = placeholder;
1618

1719
/// @nexus.proto "temporal.api.common.v1.Payloads"
1820
/// typescript-import="@temporalio/proto"
19-
/// @nexus.type dotnet="IReadOnlyCollection<object?>" dotnet-to="ProtoExtensions.ToPayloads"
21+
/// @nexus.type
2022
/// java="java.util.List<Object>"
23+
/// go="[]any"
24+
/// dotnet="IReadOnlyCollection<object?>"
25+
/// dotnet-from="ProtoExtensions.FromPayloads"
26+
/// dotnet-to="ProtoExtensions.ToPayloads"
2127
type payloads = list<payload>;
2228

29+
/// Temporal failure represented by the target SDK's native exception/error type.
30+
/// The SDK failure converter owns the recursive cause and failure-info structure.
31+
/// @nexus.proto "temporal.api.failure.v1.Failure" typescript-import="@temporalio/proto"
32+
/// @nexus.type
33+
/// java="RuntimeException"
34+
/// java-from="failureFromProto"
35+
/// java-to="failureToProto"
36+
/// python="BaseException"
37+
/// typescript="Error"
38+
/// go="error"
39+
/// dotnet="System.Exception"
40+
/// dotnet-from="ProtoExtensions.FromFailureProto"
41+
/// dotnet-to="ProtoExtensions.ToFailureProto"
42+
type failure = placeholder;
43+
2344
/// Callable result annotation for workflow functions.
2445
/// @nexus.type
2546
/// python="collections.abc.Awaitable[WorkflowResult]"
2647
/// typescript="Promise<any>"
48+
/// go="any"
2749
/// dotnet="System.Threading.Tasks.Task<object?>"
2850
type workflow-result = placeholder;
2951

3052
/// Receiver/context argument for workflow callable method forms.
31-
/// @nexus.type python="typing.Any" typescript="any" dotnet="object"
53+
/// @nexus.type python="typing.Any" typescript="any" go="go.temporal.io/sdk/workflow:workflow.Context" dotnet="object"
3254
type callable-prefix = placeholder;
3355

3456
/// @nexus.function-args
@@ -38,7 +60,7 @@ interface model {
3860
workflow-call: async func(callable-prefix: callable-prefix, args: payloads) -> workflow-result;
3961

4062
/// Callable result annotation for signal functions.
41-
/// @nexus.type python="None | collections.abc.Awaitable[None]" typescript="void" dotnet="void"
63+
/// @nexus.type python="None | collections.abc.Awaitable[None]" typescript="void" go="any" dotnet="void"
4264
type signal-result = placeholder;
4365

4466
/// @nexus.function-args
@@ -54,7 +76,9 @@ interface model {
5476
/// java-to="workflowTypeToProto"
5577
/// python="str"
5678
/// typescript="string"
79+
/// go="string"
5780
/// dotnet="string"
81+
/// dotnet-from="ProtoExtensions.FromWorkflowTypeProto"
5882
/// dotnet-to="ProtoExtensions.ToWorkflowTypeProto"
5983
type workflow-type = placeholder;
6084

@@ -64,6 +88,7 @@ interface model {
6488
/// args-field="input"
6589
/// result-type-parameter="WorkflowResult"
6690
/// alternate-type="workflow-type"
91+
/// go-name-extractor="WorkflowFunctionName"
6792
/// dotnet-name-extractor="TemporalFunctionNames.WorkflowName"
6893
/// dotnet-call-extractor="TemporalFunctionNames.ExtractCall"
6994
/// @nexus.add-rpc-compatible-with "workflow-type"
@@ -73,13 +98,15 @@ interface model {
7398
/// signature="signal-call"
7499
/// args-field="signal-input"
75100
/// alternate-type="string"
101+
/// go-value-type="string"
102+
/// go-args-type="any"
76103
/// python-converter="signal_function_to_proto"
77104
/// typescript-name-extractor="signalFunctionName"
78105
/// dotnet-name-extractor="TemporalFunctionNames.SignalName"
79106
/// dotnet-call-extractor="TemporalFunctionNames.ExtractCall"
80-
/// typescript-value-type="workflow.SignalDefinition<any[]>"
81-
/// typescript-args-type="Value extends workflow.SignalDefinition<infer Args, any> ? Args : never"
82-
/// typescript-import="@temporalio/workflow"
107+
/// typescript-value-type="common.SignalDefinition<any[]>"
108+
/// typescript-args-type="Value extends common.SignalDefinition<infer Args extends any[], any> ? Args : never"
109+
/// typescript-import="@temporalio/common"
83110
/// @nexus.add-rpc-compatible-with "string"
84111
type signal-function = placeholder;
85112

@@ -90,7 +117,9 @@ interface model {
90117
/// java-to="retryPolicyToProto"
91118
/// python="temporalio.common.RetryPolicy"
92119
/// typescript="common.RetryPolicy"
120+
/// go="go.temporal.io/sdk/temporal.RetryPolicy"
93121
/// dotnet="Temporalio.Common.RetryPolicy"
122+
/// dotnet-from="ProtoExtensions.FromRetryPolicyProto"
94123
/// typescript-import="@temporalio/common"
95124
type retry-policy = placeholder;
96125

@@ -101,22 +130,36 @@ interface model {
101130
/// java-to="taskQueueToProto"
102131
/// python="str"
103132
/// typescript="string"
133+
/// go="string"
104134
/// dotnet="string"
135+
/// dotnet-from="ProtoExtensions.FromTaskQueueProto"
105136
/// dotnet-to="ProtoExtensions.ToTaskQueueProto"
106137
type task-queue = placeholder;
107138

108139
/// @nexus.proto "temporal.api.common.v1.Memo" typescript-import="@temporalio/proto"
109-
/// @nexus.type python="collections.abc.Mapping[str, typing.Any]" typescript="Record<string, unknown>" dotnet="IReadOnlyDictionary<string, object?>"
140+
/// @nexus.type
110141
/// java="java.util.Map<String, Object>"
111142
/// java-from="memoFromProto"
112143
/// java-to="memoToProto"
144+
/// python="collections.abc.Mapping[str, typing.Any]"
145+
/// typescript="Record<string, unknown>"
146+
/// go="map[string]any"
147+
/// dotnet="IReadOnlyDictionary<string, object?>"
148+
/// dotnet-from="ProtoExtensions.FromMemoProto"
113149
type memo = placeholder;
114150

115-
/// @nexus.proto "temporal.api.common.v1.Header"
151+
/// @nexus.proto "temporal.api.common.v1.Header" typescript-import="@temporalio/proto"
116152
/// @nexus.type
117153
/// java="java.util.Map<String, io.temporal.api.common.v1.Payload>"
118154
/// java-from="headerFromProto"
119155
/// java-to="headerToProto"
156+
/// python="collections.abc.Mapping[str, typing.Any]"
157+
/// typescript="common.Headers"
158+
/// go="map[string]any"
159+
/// dotnet="IReadOnlyDictionary<string, object?>"
160+
/// dotnet-from="ProtoExtensions.FromHeaderProto"
161+
/// dotnet-to="ProtoExtensions.ToHeaderProto"
162+
/// typescript-import="@temporalio/common"
120163
type header = placeholder;
121164

122165
/// @nexus.proto "temporal.api.common.v1.SearchAttributes" typescript-import="@temporalio/proto"
@@ -126,7 +169,9 @@ interface model {
126169
/// java-to="searchAttributesToProto"
127170
/// python="temporalio.common.TypedSearchAttributes"
128171
/// typescript="common.TypedSearchAttributes"
172+
/// go="go.temporal.io/sdk/temporal.SearchAttributes"
129173
/// dotnet="Temporalio.Common.SearchAttributeCollection"
174+
/// dotnet-from="ProtoExtensions.FromSearchAttributesProto"
130175
/// typescript-import="@temporalio/common"
131176
type search-attributes = placeholder;
132177

@@ -137,7 +182,9 @@ interface model {
137182
/// java-to="priorityToProto"
138183
/// python="temporalio.common.Priority"
139184
/// typescript="common.Priority"
185+
/// go="go.temporal.io/sdk/temporal.Priority"
140186
/// dotnet="Temporalio.Common.Priority"
187+
/// dotnet-from="ProtoExtensions.FromPriorityProto"
141188
/// typescript-import="@temporalio/common"
142189
type priority = placeholder;
143190

@@ -148,7 +195,9 @@ interface model {
148195
/// java-to="versioningOverrideToProto"
149196
/// python="temporalio.common.VersioningOverride"
150197
/// typescript="common.VersioningOverride"
198+
/// go="go.temporal.io/sdk/client.VersioningOverride"
151199
/// dotnet="Temporalio.Common.VersioningOverride"
200+
/// dotnet-from="ProtoExtensions.FromVersioningOverrideProto"
152201
/// typescript-import="@temporalio/common"
153202
type versioning-override = placeholder;
154203

@@ -159,7 +208,9 @@ interface model {
159208
/// java-to="durationToProto"
160209
/// python="datetime.timedelta"
161210
/// typescript="common.Duration"
211+
/// go="time.Duration"
162212
/// dotnet="System.TimeSpan"
213+
/// dotnet-from="ProtoExtensions.FromDurationProto"
163214
/// typescript-import="@temporalio/common"
164215
type duration = placeholder;
165216

@@ -168,6 +219,7 @@ interface model {
168219
/// java="io.temporal.api.enums.v1.WorkflowIdReusePolicy"
169220
/// python="temporalio.common.WorkflowIDReusePolicy"
170221
/// typescript="common.WorkflowIdReusePolicy"
222+
/// go="go.temporal.io/api/enums/v1:enums.WorkflowIdReusePolicy"
171223
/// dotnet="Temporalio.Api.Enums.V1.WorkflowIdReusePolicy"
172224
/// typescript-import="@temporalio/common"
173225
type workflow-id-reuse-policy = placeholder;
@@ -177,20 +229,23 @@ interface model {
177229
/// java="io.temporal.api.enums.v1.WorkflowIdConflictPolicy"
178230
/// python="temporalio.common.WorkflowIDConflictPolicy"
179231
/// typescript="common.WorkflowIdConflictPolicy"
232+
/// go="go.temporal.io/api/enums/v1:enums.WorkflowIdConflictPolicy"
180233
/// dotnet="Temporalio.Api.Enums.V1.WorkflowIdConflictPolicy"
181234
/// typescript-import="@temporalio/common"
182235
type workflow-id-conflict-policy = placeholder;
183236

237+
/// @nexus.doc "Static metadata for a workflow execution."
184238
/// @nexus.proto "temporal.api.sdk.v1.UserMetadata" typescript-import="@temporalio/proto"
185239
/// @nexus.flatten-in-api
240+
/// @nexus.experimental
186241
record user-metadata {
187242
/// @nexus.doc "Single-line fixed summary for the workflow execution that may appear in UI and CLI. This can be in single-line Temporal Markdown format."
188243
/// @nexus.proto-field "summary"
189-
/// @nexus.flattened-type python="str" typescript="string" dotnet="string"
244+
/// @nexus.flattened-type python="str" typescript="string" dotnet="string" go="string"
190245
static-summary: option<payload>,
191246
/// @nexus.doc "General fixed details for the workflow execution that may appear in UI and CLI. This can be in Temporal Markdown format and can span multiple lines. This value is fixed on the workflow execution and cannot be updated."
192247
/// @nexus.proto-field "details"
193-
/// @nexus.flattened-type python="str" typescript="string" dotnet="string"
248+
/// @nexus.flattened-type python="str" typescript="string" dotnet="string" go="string"
194249
static-details: option<payload>,
195250
}
196251
}

0 commit comments

Comments
 (0)