This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

How to define data type for action inputs?

I have a subworkflow that has one action:

version: 1.0

description: “Run average calculation on score”

input:
  - score

tasks:
  get_score:
    action: tf.run_calculator
    input:
          score: <% ctx().score %>

Now when I run this subworkflow using st2 run myPack.myAction score=20 it sends string score to underlying action. Is there a way to set data type here?

NB: I’ve seen samples that we can set type: "integer" on action inputs, but what about subworkflows? How can I set data type for my score input?

Hi @alirezastack,

You should able to specify the datatype in the workflow action metadata file. Following is an example.

here is the workflow action metadata file.

name: myAction
pack: myPack
description: Run average calculation on score.
runner_type: orquesta
entry_point: workflows/average-calculator.yaml
enabled: true
parameters:
  score:
    required: true
    type: integer
    default: 0

here is the workflow itself.

version: 1.0
description: “Run average calculation on score”

input:
  - score

tasks:
  get_score:
    action: tf.run_calculator
    input:
          score: <% ctx().score %>