Skip to content

Nested foreach fails at runtime, but validation succeeds #246

@sebastianrosch

Description

@sebastianrosch

I have a workflow with a nested foreach.
The workflow passes validation, the following call does not return any output:

fission wf validate nested.wf.yaml

Creating the workflow works:

fission fn create --name nested --env workflow --src nested.wf.yaml

When running the workflow with

curl ${FISSION_ROUTER}/fission-function/nested

it fails with input 'do' is not a validType type (expected: [fission.workflows.types.TaskSpec], was: string)

Are nested foreach supported? Or is there something wrong with my workflow definition?

nested.wf.yaml:

apiVersion: 1
output: Iterate
tasks:

  # Builds a list of details
  BuildObjects:
    run: foreach
    inputs:
      foreach: ["test","test2","test3"]
      do:
        run: compose
        inputs:
          parentInvocationId: "{$.Invocation.Id}"
          name: "task().element"
          resources: ["r1","r2"]

  # Iterates over all objects and their resources
  Iterate:
    run: foreach
    inputs:
      foreach: "{$.Tasks.BuildObjects.Output}"
      do:
        run: foreach
        inputs:
          foreach: "{task().Inputs._item.resources}"
          do:
            run: nop
            inputs: "{ task().element }"
    requires:
      - BuildObjects

$ fission --version
client:
  fission/core:
    gitcommit: ee988f5a8b423926056f64bc64b5a8ed516a7261
    builddate: 2019-02-08T12:57:56Z
    version: "1.0"
  workflows:
    gitcommit: ""
    builddate: ""
    version: 0.6.0
server:
  fission/core:
    gitcommit: ee988f5a8b423926056f64bc64b5a8ed516a7261
    builddate: 2019-02-08T12:57:56Z
    version: "1.0"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions