Skip to content

feat(workflow): add LambdaTask builder for TaskType.LAMBDA#440

Open
rahul188 wants to merge 1 commit into
conductor-oss:mainfrom
rahul188:add-lambda-task-builder
Open

feat(workflow): add LambdaTask builder for TaskType.LAMBDA#440
rahul188 wants to merge 1 commit into
conductor-oss:mainfrom
rahul188:add-lambda-task-builder

Conversation

@rahul188

Copy link
Copy Markdown

Summary

Closes #427

TaskType.LAMBDA is present in the SDK's enum, but there was no LambdaTask builder class, so LAMBDA tasks could only be constructed from raw dicts. This adds the missing builder.

Change

Add src/conductor/client/workflow/task/lambda_task.py with a LambdaTask that mirrors InlineTask: it sets scriptExpression from the script argument and merges any bindings into input_parameters. The resulting workflow task serializes with type: "LAMBDA" and the expected inputParameters, matching the server-side shape in the issue.

from conductor.client.workflow.task.lambda_task import LambdaTask

LambdaTask(
    task_ref_name="compute",
    script="(function(){ return {out: $.x + 1}; })()",
    bindings={"x": "${workflow.input.x}"},
)

Tests

Added tests/unit/workflow/test_lambda_task.py, covering the scriptExpression construction, the to_workflow_task() type (LAMBDA), and bindings merge. Both pass against the SDK.

Closes conductor-oss#427

TaskType.LAMBDA existed in the enum but had no builder class, so LAMBDA tasks
could only be constructed from raw dicts via the Python SDK. Add a LambdaTask
builder that mirrors InlineTask: it sets scriptExpression from the script
argument and merges any bindings into input_parameters.

Signed-off-by: rahul188 <rahulkuchhadia@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No LambdaTask builder class — TaskType.LAMBDA exists in enum but is unusable

1 participant