Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

What should I replace a "Timeout Until" step with when converting background workflows to real-time workflows?

Posted on by Microsoft Employee

I have a bunch of background workflows that need to be converted to real-time workflows so that the "Modified By" field doesn't get updated with the workflow owner.  The problem is that a lot of the workflows that need to be converted have a "Timeout Until" step where the workflow waits one minute to run.  These "Timeout Until" steps are necessary, as there are plug-ins and other workflows that need to run first in order for these workflows to run correctly.

I do not believe it is possible to use "Timeout Until" in a real-time workflow.  My question is what should I replace "Timeout Until" with?  I want certain workflows to execute AFTER other workflows, so I need some sort of replacement.

Below is an example of a background workflow I need to convert to a real-time workflow:

1563.Workflow1.PNG

Any help/workaround suggestions would be greatly appreciated.  Thanks!

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: What should I replace a "Timeout Until" step with when converting background workflows to real-time workflows?

    Hi,

    I don't think it is available open source but it is very simple if you know some basics of custom workflow? You just need to add a parameter which accepts time in miliseconds and then use Thread.Sleep for that parameter.

    Something like this

    ======================

    using System.Activities;

    using Microsoft.Xrm.Sdk.Workflow;

    namespace Workflow.Test

    {

       public class TimeOut : CodeActivity

       {

           [RequiredArgument]

           [Input("Timeout (in milliseconds)")]

           public InArgument<int> inTimeout { get; set; }

           protected override void Execute(CodeActivityContext executionContext)

           {

               var timeout = inTimeout.Get(executionContext);

               System.Threading.Thread.Sleep(timeout);

           }

       }

    }

    ======================

    You can refer this sample www.ashishvishwakarma.com/.../

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: What should I replace a "Timeout Until" step with when converting background workflows to real-time workflows?

    Hi Ravi,

    Thank you for your reply.  Are you aware of any workflows like this that exist in GitHub or somewhere else online?  I am not very technical and don't think I'd be able to create this custom workflow on my own.

    If not, are there any other possible workarounds that don't involve custom workflows activities?

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: What should I replace a "Timeout Until" step with when converting background workflows to real-time workflows?

    Hi,

    There is no such replacement available out of box. If you just need to implement a timeout for say 1 minute of few seconds, you can create a custom workflow activity which uses Thread.Sleep for that amount of time.

    With this workflow activity, you can replace your Timeouts statement but you may not be able to replace all other process statements like wait until (in this example).

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans