Add feature to allow infinite loops on workflows

Status: Idea Submitted

I am wanting my workflow to continuously reenroll / create new deal records but I receive an error message that says HubSpot workflows don’t allow for infinite loops and it manually removed my record to complete the automation.

This would be a nice feature to have as we are trying to streamline some of our business processes all through workflow triggers to alert our sales team on reoccuring tasks / deals / pipeline.

Hi @VKnotts

What exactly do you want to do? From experience, there is a good reason why HubSpot prevents this - people will break the unbreakable if given the opportunity. There are ways to create intentional loops (ideally not infinite cause that would be a whole lot deals getting created in your portal and there are limits), you just have to get creative with triggers and custom properties.

Frank

So one thing that you can do is to use scheduled workflows if you need to repeatedly create a deal or tasks or something on a regular basis. However, if you need them created on some condition, just do what the above reply says and create the correct trigger conditions in your workflow.

I wouldn’t like infinite loops, but it would be nice to be able to create loops that have an exit condition. To do this now, I have to use a pair of workflows. One has the actions and looks for the exit conditions. If the conditions aren’t met, it sends the record to the second workflow which delays and then sets a property value to the re-enrollment value for the first workflow. My loops can get a bit more complex than that, depending on what I’m trying to achieve, but they all essentially work that way. It’s a shortcut around the ban on infinite loops.

Unfortunately, HubSpot doesn’t seem to recognize when the loop is only infinite until the exit conditions are met.

I imagine that my companies issue with hubspot preventing ‘infinitely loops’ is likely the most common: it relates to our need to create renewal deals.

We are a SaaS company and therefore deal in annual contracts. We want to create a deal-based workflow that triggers whenever a deal hits the ‘closed won’ deal stage. The workflow would then create a new deal record: the ‘renewal deal’. The new, ‘renewal deal’ would then (hopefully) get moved to closed won 365 days after the preceeding deal (the one that triggered the workflow and triggered the creation of the renewal deal), then re-enter the workflow, and create a 2nd renewal deal. This would repeat itself year after year, for as long as customers continued to renew contracts.

But we can’t set this up, since HubSpot won’t allow a deal that has been created by a workflow to then enter that workflow.

I don’t actually think there is any risk of creating an ‘infinite loop’, since, in order to enter the workflow, a deal’s deal stage has to be ‘closed won’, and thats not a deal stage that the created deal starts in.

I’m wondering how companies handle the creation of ‘renewal deals’, given the fact that preventing ‘infinite loops’ seems to prohibit this type of automation…

@JMayhew6 A couple of ideas:

  1. Is this workflow created in the pipeline stage, or outside of it? Creating the workflow in the workflow tool rather than the pipeline stage gives you more flexibility when setting up re-enrollment. I see no reason that a deal created in a workflow wouldn’t be able to enroll in that workflow later, but I’m not sure that we’ve ever tried this.
  2. As mentioned above, ensuring that your enrollment criteria is set up for re-enrollment would be important here. Also, event-based workflows are great for this as well.

We too need a way to clone custom objects in support of renewals. Each custom object, which we call a “project” is for a specific time period and renewals must be captured in a new project. Because projects have a substanial amount of fields, and many of those fields stay the same when a project is renewed, we’ve created a workflow to help automate the process. A field that is manually updated on the the project record triggers a workflow which creates a new record and copies the relevant fields over. The initial trigger is not copied over in order to prevent an infinite loop. Our issue is with multi-year renewals. We can only clone a project once before the infinite loop error kicks in. However, we need the ability to clone year over year. Cloning only happens once per year and can only be achieved by a team member manually updating the trigger field. However, the most recent update to workflows no longer allows a clone of a clone, even if it is triggered by a manual field update. I understand the precaution, I’m guessing someone accidentally created an infinite loop that was probably a nightmare to fix, but we need some sort of workaround.

@SFoltz88, @JMayhew6 is right, you can’t have a workflow create a deal and use the same workflow to re-create a new deal using that same deal.
We’re trying to do this for the same reason as a few people have mentioned here. I’ve created a mammoth workflow that allows my sales team to handle automatically and manually renewing deals in 3, 6, 12 and 24 month cycles. We had it all working nicely until one of the deals came up for its second renewal.

The first deal was created manually, the second created by the workflow, and the third deal in the chain failed because the workflow had created the second deal and wouldn’t allow itself to create the third deal in order to prevent an infinite loop.

Technically and literally speaking, an infinite loop is what I want, just 3, 6, 12 and 24 months apart. :grinning_face_with_smiling_eyes:

We need a way to allow workflows to create this kind of ‘infinite loop’ but agreeably with some condition in there that prevents the creator of a workflow from accidentally spawning a million deals. Perhaps a minimum condition so that an infinite loop is only allowed once every day, or every 30 days, for example.

We have two workflows that work in tandem to one another, one is the primary workflow that attempt to create associations. This workflow has several variation of “exit” trigger for the loop, some of which send the object to a second workflow that will verify some of the conditions of the first exit trigger and set some text fields with values to re-enroll it into the first workflow. The workflow will attempt the association 4 times, using a count increase to track this. The ending exit conditions are either the count reaches 4, or the association was successful. If the count reaches 4, a different text field is set to a value indicating an error so that this can be tracked by our tech team.

Sharing some feedback here on the way that HubSpot checks for “infinite loops” currently is that if the record that enrolls in a certain workflow was created from the same workflow, it would not be able to create a new record from there. However, this might not be entirely representative of that “infinite loop” that they’re trying to prevent as the record could have only enrolled in the workflow after some time, and not immediately from the “Create record” action to meet the enrollment triggers.

Hoping to see this validation of “infinite loops” being improved in future to account for such cases!

+1

We really need this feature! Our use case is for creating renewal deals. When a deal is closed won in the sales pipeline, the workflow creates a renewal deal in our renewal pipeline. This works fine. Then when this renewal deal successfully renews, we need to create the next year’s renewal deal but the workflow doesn’t let me because it’s saying the original deal was already created by the same workflow.

This is just one example use case but I’m sure there are many other examples where a record does need to be created on regular intervals using the same workflow. Please make this feature available!