Skip to content

Commit 9852279

Browse files
committed
encode in enqueue, client
1 parent bf35e78 commit 9852279

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dbos/client.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ func (c *client) Enqueue(queueName, workflowName string, input any, opts ...Enqu
147147
if params.priority > uint(math.MaxInt) {
148148
return nil, fmt.Errorf("priority %d exceeds maximum allowed value %d", params.priority, math.MaxInt)
149149
}
150+
151+
// Serialize input before storing in workflow status
152+
encodedInput, err := serialize(params.workflowInput)
153+
if err != nil {
154+
return nil, newWorkflowExecutionError(workflowID, fmt.Errorf("failed to serialize workflow input: %w", err))
155+
}
156+
150157
status := WorkflowStatus{
151158
Name: params.workflowName,
152159
ApplicationVersion: params.applicationVersion,
@@ -155,7 +162,7 @@ func (c *client) Enqueue(queueName, workflowName string, input any, opts ...Enqu
155162
CreatedAt: time.Now(),
156163
Deadline: deadline,
157164
Timeout: params.workflowTimeout,
158-
Input: params.workflowInput,
165+
Input: encodedInput,
159166
QueueName: queueName,
160167
DeduplicationID: params.deduplicationID,
161168
Priority: int(params.priority),

0 commit comments

Comments
 (0)