How to allow customers to create complex workflows using PipeDream's Connect API in a support/sales app?

This topic was automatically generated from Slack. You can find the original thread here.

Hello everyone,

I’m planning to integrate PipeDream into my AI Support/Sales app. I want to use Connect API with react SDK to allow my customers create workflows directly through my dashboard. I can see how authentication and component (action, trigger, app, etc.) retrieval successfully works in Connect Demo App but what about workflow creation?

As I understand, Submit buttons for action and triggers in the demo app are executing the trigger (calls configured webhook URL) or the action (does what the action does in PipeDream infrastructure) but how will my customers create more complex workflows where they connect conditionals, triggers, and actions? Do I have to create that UI myself? If yes, what is the use of Connect?

I’m very new to PipeDream and trying to understand it and make use of it in my app so any help is appriciated.

Hey Hasan, with most of the Connect functionality (including what you’re seeing in that demo app), there is no workflow that’s executing in the background. That API enables you to execute individual actions (prebuilt tools) and triggers outside of the context of a Pipedream workflowl.

You can also build and deploy workflows in Pipedream that you run on behalf of your end users via Connect (docs), but for a use case like yours, it sounds like that’s probably not what you want.

I see what you mean. Then I can define some ‘static’ workflows for my customers and trigger them on behalf of them. Let’s say the workflow has a ‘received email’ trigger, then when I invoke the workflow for an end user once, it will work forever for all 'received email’s of that end user, right?

If so, I can list my ‘static’ workflows in my dashboard and invoke them if an end user selects any of them.

Also what if, an end user hasn’t yet authed some of the apps used in a workflow that I want to run on behalf of them?

Yea if you want to pre-configure some static workflows in Pipedream and invoke them on behalf of your end users, you can definitely do that. And yea if you want to use a “received email” trigger for example, you can call deployTrigger and make sure to subscribe the deployed workflow (docs).

Also what if, an end user hasn’t yet authed some of the apps used in a workflow that I want to run on behalf of them?
The workflow will fail prior to executing, so you’ll need to make sure your users have connected all the relevant accounts ahead of time.

Let’s say it is ‘Gmail’, then to execute a workflow with an action of Gmail app, I have to use my own Gmail client, right?

As I understand, if the application’s type is oAuth, only the end user’s itself may run pre-built tools with Connect. Workflow execution on behalf of the end user is not possible in this scenario.

That’s right, if you’re executing workflows on behalf of end users you need to use your own OAuth clients. You can use Pipedream’s when executing triggers and actions via the API.

Why are you limiting using PipeDream’s client with workflows? Is it a technical limitation, a design choice or policies of third parties?

Also even if we run workflows with apps oAuthed with our own app clients, there will be no UI for selecting the params (e.g. Google Sheets → Add to Row | but to which row) so it is not really useful. (You already aware of it) Because it is not me who will select which table the row will be added to but it is the end user. Select screen for each param should be manually implemented for each workflow we defined.

I also couldn’t find any limitation or price rate for actions/triggers executed using the API.

Let’s say I decided to go with PipeDreams’s clients and will only deploy/run triggers/actions on behalf of them. In this case triggers and actions should still be working on your infra because you wouldn’t provide access tokens to my backend. Then what is the limitations/pricing on those?

Are triggers/actions considered as a workflow and consumes credits (1 credit per 30 seconds)?

Why are you limiting using PipeDream’s client with workflows? Is it a technical limitation, a design choice or policies of third parties?
A bit of a combination of those — we need to control how and where access tokens are used when an account is connecting with a Pipedream OAuth client, so we can better protect against spam and abuse from our OAuth clients.

Also even if we run workflows with apps oAuthed with our own app clients, there will be no UI for selecting the params (e.g. Google Sheets → Add to Row | but to which row) so it is not really useful. (You already aware of it) Because it is not me who will select which table the row will be added to but it is the end user. Select screen for each param should be manually implemented for each workflow we defined.
That’s correct, and that’s why I suspect that option probably doesn’t make sense for you.

Are triggers/actions considered as a workflow and consumes credits (1 credit per 30 seconds)?
Yes, 1 action execution == 1 credit, as well as 1 trigger invocation == 1 credit, that’s a good call that that isn’t explicitly laid out anywhere, we’ll address that.