FAQ: Does a workflow still trigger if the source is disabled? Or do both need to be activated (and thus a workflow run is actually 2 invocations)?

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

Diego Bennett : Does a workflow still trigger if the source is disabled? Or do both need to be activated (and thus a workflow run is actually 2 invocations)?

Dylan Sather (Pipedream) : That’s correct: when a workflow is triggered by a source, the workflow won’t run if the source is disabled. Since an event source runs as its own resource, we do count an invocation each time the source runs, and each time the workflow runs.

Which source are you using in this case?

Diego Bennett : GSheet Instant trigger. Somehow I hit 350 invocations today despite my intended workflow only running 5 times. So I just disabled a ton of extra sources/workflows that were maybe running automatically somehow?

Diego Bennett : We’ll upgrade to pro soon but just want to make sure we’re being efficient with configuration before we scale.

Dylan Sather (Pipedream) : Thanks for that detail. We actually just reduced the default number of invocations for the Google Sheets sources from a minimum of ~96 per day to 2 (see here for details on the issue). You can create a new version of the Google Sheets source at https://pipedream.com/sources/new , and use that to trigger your workflow, if you’d like.

Sergio Rodriguez : so what if two workflow are triggered by a source with the same configuration. Would that account as 3 invocations, or 4? I am guessing if there’s some optimization considering a source executed with the same config.

Another question that I see arise is, could you define http triggered workflows and use the http endpoint for the workflows and execute them from the source by hitting the http endpoint of the workflow explicitly from the source’s code? would this help reducing the number of invocations?

Finally, how advisable it is to have the a workflow logic embedded in a source? I am thinking there could be use cases where the workflow content is small and thus could be OK to include in the source’s run method. Is there other constraints, besides that fact that execution time in sources is 30secs but on workflow you can extend to 5 min?

Dylan Sather (Pipedream) : 1. When a source emits an event and triggers workflows, we only count one invocation for the source and one each for the N workflows. So in your example, we count 3 invocations: 1 for the source, 2 for the 2 workflows.
2. Yes since you can run any Node.js code from a source, you can put a lot of logic in the source itself. The source environment is a bit more limiting since you don’t have access to easy-to-use actions and other useful workflow features, but it’s a good approach in certain circumstances.