Warp icon indicating copy to clipboard operation
Warp copied to clipboard

Workflow options or default arguments

Open vgarvardt opened this issue 3 years ago • 7 comments

Discord username (optional)

No response

Describe the solution you'd like?

Workflows are really great idea - already migrated almost all my code snippets from notes. But one feature is missing for me - predefined options for an argument.

E.g., I have several snippets like this:

---
name: AWS SSO Login <profile-name>
command: "aws sso login --profile <profile-name>"
tags: [aws, sso]
description: "Login to AWS <profile-name>"
arguments: []

with around 10 predefined profiles. Currently I can either create 10 workflows, or define profile name as an argument, but then I need to remember all of them and type them manually. Yes, autocomplete will help me the second time, but anyway free-type input does not make any sense in this case.

It would be great to have arguments.options field with the list of pre-defined values that will be available when selecting a workflow, so for the example above it will be something like

---
name: AWS SSO Login
command: "aws sso login --profile {{profile-name}}"
tags: [aws, sso]
description: "Login to AWS profile"
arguments:
  - name: profile-name
    description: AWS profile name
    options: [ foo, bar, baz ]

This is just one of the examples, I have several commands like this with limited list of arguments that are currently duplicated as several workflows with predefined commands for every possible input.

vgarvardt avatar Apr 10 '22 20:04 vgarvardt

Yes! I would even expand options value to contain labels too, like:

---
name: AWS SSO Login
command: "aws sso login --profile {{profile-name}}"
tags: [aws, sso]
description: "Login to AWS profile"
arguments:
  - name: profile-name
    description: AWS profile name
    options:
      - label: label1
        value: value1
      - label: label2
        value: value2 

It would be helpful for UUID-like values.

horbo avatar Apr 21 '22 10:04 horbo

Gonna flag this again to the team

elviskahoro avatar Jul 08 '22 18:07 elviskahoro

came here looking to see if this feature existed or was already requested - glad to see I'm not the only one that would like this feature.

My use-case is that I have a bunch of database server urls that I would love to be able to add into my workflows and choose which database to connect to via workflow arguments. I have +10 postgresql databases each with unique URLs that I work with so having the urls as options available in the workflow itself would be awesome.

There is a bit of structure to the URLs but we cannot "template" them completely because each one has a unique part in their URL that is basically just random characters, for example: test-db-1.dj8ax1brwtms.us-west-2.rds.amazonaws.com

@horbo 's suggestion is pretty much exactly what I would want, a value and a label - and way to choose the option in the warp workflow ui, possibly even have an extra key in the argument structure to specify which option is the default. Always defaulting to the first one would also be fine too.

arguments:
  - name: profile-name
    description: AWS profile name
    default: 0
    options:
      - label: label1
        value: value1
      - label: label2
        value: value2 

tchamberland avatar Aug 06 '22 18:08 tchamberland

Please +1 this request as it helps us gauge interest. We will post any updates here.

Some great suggestions for the same in #2176

dannyneira avatar Nov 18 '22 19:11 dannyneira

user comment:

It's great to save workflows that have variable arguments. If this isn't currently doable, it would be great if there was a way of saving common values used for those arguments and selecting which values to use with a given workflow.

dannyneira avatar Jul 31 '23 22:07 dannyneira