镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Passing query result to next action? #18

Open

Description

@gnudiff

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.

Activity

  1. bishopbm1 commented on Jan 25, 2022

    @bishopbm1
    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?

  2. ShawnHardwick commented on Mar 31, 2022

    @ShawnHardwick

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions