Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to dynamically pass nullable inputs from parent flow to subflow #6624

Open
rybandrei2014 opened this issue Jan 2, 2025 · 1 comment
Labels
area/backend Needs backend code changes bug Something isn't working

Comments

@rybandrei2014
Copy link
Contributor

Describe the issue

Hello team,

I have a flow that triggers subflow via Subflow task

id: TEST_NULL_ZPRACOVANI
namespace: csutrf
inputs:
- id: integerNull
  type: INT
  required: false
labels: []
tasks:
- id: TEST_NULL_1_subflow
  type: io.kestra.plugin.core.flow.Subflow
  namespace: csutrf
  flowId: TEST_NULL_1
  inputs:
    integerNull: "{{ inputs.integerNull }}"
concurrency:
  limit: 1
  behavior: CANCEL

id: TEST_NULL_1
namespace: csutrf
inputs:
- id: integerNull
  type: INT
  required: false
labels: []
tasks:
- id: log1
  type: io.kestra.plugin.core.log.Log
  message: "{{ inputs.integerNull }}"

I need to pass input variable from parent flow to the subflow. It works fine until the value is null, when I trigger parent flow with input that has flag required = false. The Subflow task throws the following error

integerNull: Invalid input for integerNull, For input string: "", but received `` 

I tried to modify the expression

"{{ inputs.integerNull }}" -> "{{ inputs.integerNull ?? 'null' }}" 

But it also throws an error

integerNull: Invalid input for integerNull, For input string: "null", but received null

Is it possible to somehow pass an input with a null value to the subflow?

P.S.: It's also not possible to achieve with TemplatedTask as it supports only Runnable tasks

Environment

  • Kestra Version: 0.18.4
@rybandrei2014 rybandrei2014 added area/backend Needs backend code changes area/frontend Needs frontend code changes bug Something isn't working labels Jan 2, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Issues Jan 2, 2025
@Ben8t Ben8t removed the area/frontend Needs frontend code changes label Jan 6, 2025
@loicmathieu
Copy link
Member

This is not specific to subflow or INTEGER inputs, if a variable is null, our expression engine (Pebble) will return the empty string.
We may be able to do something about it for some input types but not for STRING.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend Needs backend code changes bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants