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

Passing query result to next action? #18

Open
gnudiff opened this issue Jan 25, 2022 · 2 comments
Open

Passing query result to next action? #18

gnudiff opened this issue Jan 25, 2022 · 2 comments

Comments

@gnudiff
Copy link

gnudiff commented Jan 25, 2022

I am trying to integrate sql query in my Orquestra workflow:

--
version: 1.0
name: Daily report
description: Get daily stats 
tasks:
  task1:
    action: sql.query
    input:
      connection: my_conn
      query: "SELECT ... 
                    <long running query>
                  "
    next:
      publish: data="<% result() %>"
      do: task2
  task2:
    action: "reports.act1"
    input:
      data: "<% ctx(data) %>"

And I get error:

  errors:
  - message: The spec is not type of list.

What gives?

act1 is just a simple python action which accepts data parameter and prints out its type and contents.

@bishopbm1
Copy link
Contributor

Can you share what your action file looks like also can you share what the execution tree looks like? Also as a test if you take away task2 does it run successfully?

@ShawnHardwick
Copy link

ShawnHardwick commented Mar 31, 2022

The next key is expecting a list, not a dict.
https://docs.stackstorm.com/orquesta/languages/orquesta.html#task-transition-model

Note that I added a hyphen to the publish statement.

--
version: 1.0
name: Daily report
description: Get daily stats 
tasks:
  task1:
    action: sql.query
    input:
      connection: my_conn
      query: "SELECT ... 
                    <long running query>
                  "
    next:
      - publish: data="<% result() %>"
        do: task2
  task2:
    action: "reports.act1"
    input:
      data: "<% ctx(data) %>"

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

No branches or pull requests

3 participants