PipedreamHQ / PipedreamHQ/pipedream
[FEATURE] dependent props
- Dominant language
- JavaScript
- Stars
- 11.7k
- Forks
- 5.8k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 102
Description
**Is your feature request related to a problem? Please describe.**
Props are configurable when at least one app prop is connected & configured.
However, this becomes problematic if you make an advanced action that has multiple app props.
For example, if you have an action that has both an OpenAI and Notion app prop, then configuring just the OpenAI step will allow _any_ prop to be configured, even if that prop depends on Notion being connected:
```javascript
{
props: {
notion: {
type: "app",
app: "notion"
},
openai: {
type: "app",
app: "openai"
},
notionDatabase: {
type: "string"
}
}
}
```
In the above example, if you configure the `openai` prop with your OpenAI credentials, then the `notionDatabase` prop is available to be configured - even though `notion` isn't connected yet.
**Describe the solution you'd like**
It would be great if you could define an optional `depends` array on a given prop that will "lock" the prop until the dependent props are configured first:
```javascript
{
props: {
notion: {
type: "app",
app: "notion"
},
openai: {
type: "app",
app: "openai"
},
notionDatabase: {
type: "string",
depends: ["notion"]
}
}
}
```
In the example above, the `notionDatabase` prop wouldn't be available to be configured until `notion` is configured.
**Do you have a workaround?**
Ordering the props visually helps, but it's not a foolsafe solution.
**Comparable features in other tools?**
Docker Compose uses a similar `depends` paradigm to define dependent containers.
Contributor guide
Assessment
This issue has not been assessed yet.