Jump to content

Is there a way to use logic from other workflow?


Recommended Posts

Desired Result: Use logic from one workflow in another, to avoid duplication of logic

 

Example:

 

- I have a `Markdown Links` workflow that can generate a markdown link from the current Chrome tab

- `Workflow 2` wants to leverage that logic without having to duplicate it

 

So what would be nice would be being able to call the external trigger for `Markdown Links`, have it return back the link it generated back to `Workflow 2`, and do whatever I want with it.

 

The problem is that it doesn't seem like the `External Trigger` output allows to you do subsequent logic (in other words, it's just a "stub" at the right of the object).

 

Workaround (?)

 

I guess a workaround (that at least works in this case), would just be to:

 

1. Have `Markdown Links` copy the generated text to the clipboard

2. Call its external trigger from `Workflow 2`

3. Simultaneously (since you can't do logic _after_ calling an External Trigger):

  1. Wait .2 seconds (for the trigger to finish)

  2. Paste the text where necessary

 

But I think that's only going to work in a few scenarios. In others, pasting may not work or be desired in any capacity.

Link to comment

You’ll need both an External Trigger and a Call External Trigger Output to allow both Workflows to communicate back and forth. You can avoid them always firing by setting some Environment Variables and checking for them.


That can become a tad convoluted, but without seeing your Workflows, there’s not much chance to be more specific.


Another way would be to make your action into a Script that you have on your machine and have both Workflows call it, but that might not be ideal in this case.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...