SOLVED

SharePoint Workflows: Extend Timeout

%3CLINGO-SUB%20id%3D%22lingo-sub-200928%22%20slang%3D%22en-US%22%3ESharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-200928%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20do%20I%20extend%20the%20execution%20time%20of%20a%20SharePoint%20workflow%3F%26nbsp%3B%20Currently%20we%20are%20concerned%20with%20SharePoint%202016%20Workflows.%26nbsp%3B%20It%20appears%20to%20be%20running%20for%20around%2020%20minutes%20and%20then%20terminates.%26nbsp%3B%20The%20events%20that%20we%20have%20associated%20to%20it%20are%20terminating%20at%20random%20locations.%26nbsp%3B%20The%20code%20works%20outside%20of%20workflow%20and%20for%20shorter%20running%20processes.%26nbsp%3B%20So%2C%20we%20are%20thinking%20timeout.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20executed%20the%20following%20in%20an%20attempt%20to%20extend%20workflow%20to%2030%20minutes.%3C%2FP%3E%3CP%3E%3CSTRONG%3Estsadm%20-o%20setproperty%20-pn%20workflow-eventdelivery-timeout%20-pv%20%2230%22%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20something%20else%20that%20we%20can%20do%2C%20or%20that%20I%20am%20missing%2C%20to%20extend%20this%3F%26nbsp%3B%20We%20can%20attempt%20reconfiguration%20to%20make%20things%20run%20shorter%3B%20however%2C%20I%20would%20like%20to%20have%20control%20over%20how%20long%20things%20can%20run.%26nbsp%3B%20I%20don't%20want%20to%20limit%20the%20process%2C%20but%20be%20able%20to%20lengthen%20it%20if%20needed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3ECraig%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204395%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204395%22%20slang%3D%22en-US%22%3EThe%20same%20workflow%20works%20fine%20for%20other%20items%20in%20the%20list.%20It%20is%20just%20failing%20for%20a%20large%20item%20that%20takes%20longer%20than%2020%20minutes%20to%20run.%20I%20don't%20believe%20that%20it's%20our%20code%2C%20it's%20the%20fact%20that%20we%20need%20the%20workflow%20to%20run%20longer%20that%20SharePoint%20allows.%20We%20may%20need%20to%20implement%20an%20event%20or%20something%20that%20tells%20WF%20to%20wait.%20We%20just%20need%20WF%20to%20run%20longer.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-203842%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-203842%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F153280%22%20target%3D%22_blank%22%3E%40Craig%20Lamb%3C%2FA%3E%26nbsp%3Bwhether%20the%20task%20list%20associated%20with%20your%20splist%20is%20crossed%20the%20threshold%20of%205K%20items%20%3F%3C%2FP%3E%3CP%3EDo%20you%20have%20managed%20metadata%26nbsp%3B%20columns(taxonomy)%20associated%20with%20workflow%20%3F%3C%2FP%3E%3CP%3EDo%20you%20have%20more%20than%208%20lookup%20columns%20or%20people%20picker%20columns%20in%20your%20SourceList%3F%3C%2FP%3E%3CP%3EHave%20you%20used%20content%20types%20in%20your%20workflow%3F%20if%20yes%2Chow%26nbsp%3B%20these%20content%20types%20are%20deployed(%20the%20best%20practice%20is%20to%20deploy%20the%20content%20type%26amp%3B%20workflow%20as%20a%20feature%20)%20at%20the%20site%20level%20and%20activate%20it%20in%20Order%20(%20this%20activation%20%2Fdeactivation%20of%20feature%20should%20be%20in%20a%20specific%20order%20else%2C%20WF%20will%20fail).%3C%2FP%3E%3CP%3EThere%20may%20be%20many%20reason%20for%20your%20WF%20termination.%3C%2FP%3E%3CP%3EDid%20you%20analyse%20logs%20folder%2Flog%20files%20through%20which%20you%20may%20get%20a%20hint%2C%20whats%20happening%20in%20the%20Env.%3F%20%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EOne%20more%20thing%20you%20can%20try%2C%20in%20the%20workflow%2C%20you%20can%20add%20a%20logtohistoryactivity%20and%20log%20all%20these%20actions%2Cwrite%20into%20an%20text%20file%2C%20thus%2C%20you%20will%20be%20able%20to%20track%20the%20source%20of%20error.%20At%20what%20point%20%2C%20its%20failing.%26nbsp%3B%20Or%20simply%20a%20codeactivity%20and%20inside%20this%20codeactivity%2C%20you%20write%20the%20values%2Cinto%20a%20text%20file.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3Eit%20may%20also%20be%20important%20that%2C%20any%20of%20the%20columns%20in%20your%20soucelist%20is%20accidentally%20deleted%20by%20your%20teammembers%20and%20they%20recreated%20thus%20the%20internal%20name%20in%20the%20CAML%20query%20might%20have%20changed...%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-203803%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-203803%22%20slang%3D%22en-US%22%3EIt's%20on%20PREM.%20All%20of%20our%20WFE's%20are%20on%20PREM%20due%20to%20government%20and%20contract%20constraints.%20We%20are%20running%202013%20and%202016%20SharePoint.%20We%20are%20creating%20WSP's%20and%20installing%20on%20each%20PROD%20deploy%2C%20etc.%20All%20the%20code%20works%20out%20of%20workflow%20and%20in.%20It's%20just%20with%20the%20large%20datasets%20it%20is%20terminating%20after%20about%2020%20minutes.%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20noted%20above%2C%20we%20attempted%20the%20following...%3CBR%20%2F%3Estsadm%20-o%20setproperty%20-pn%20workflow-eventdelivery-timeout%20-pv%20%2245%22%3CBR%20%2F%3E%3CBR%20%2F%3ESharePoint%20let%20is%20do%20it%20and%20we%20see%20the%20value%20stored%3B%20however%2C%20it's%20not%20honoring.%20I%20am%20just%20trying%20to%20find%20the%20easiest%20way%20to%20get%20SharePoint%20to%20honor%20our%20WF's%20for%20more%20time%20without%20having%20to%20redo%20everything.%20That%20would%20negate%203%20years%20of%20confidence%2C%20field%20validation%2C%20etc.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-203669%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-203669%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F153280%22%20target%3D%22_blank%22%3E%40Craig%20Lamb%3C%2FA%3E%3C%2FP%3E%3CP%3ELet%20me%20know%2C%20whats%20your%20environment%2C%20is%20it%20ON-PREM%20or%20O%20365-SPO%20and%20whats%20you%20exact%20requirement%20.%3C%2FP%3E%3CP%3EIf%20its%20ON-PREM%20you%20have%20the%20freedom%20to%20play%20along%20with%20the%20rich%20set%20of%20SSOM%20APIs.you%20can%20have%20a%20look%20at%20the%20SharePoint's%20social.msdn%20forum%20that%20has%20dedicated%20workflow%20related%20categories%20and%20source%20code%20available%20.%20Myself%20too%20posted%20many%20answers%20specific%20to%20workflow%2C-%20whether%20its%20sequential%20or%20state%20machine.%3C%2FP%3E%3CP%3EIf%20its%20SPO%20Env%2Cyou%20have%20to%20look%20at%20declarative%20workflows%26nbsp%3Bmentioned%20by%20Devendra%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F8264%22%20target%3D%22_blank%22%3E%40Devendra%20Velegandla%3C%2FA%3E%26nbsp%3B.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-203413%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-203413%22%20slang%3D%22en-US%22%3EThank%20you%20soooo%20much.%20This%20helps%20and%20is%20getting%20me%20more%20on%20track.%3CBR%20%2F%3ESo%2C%20I%20just%20need%20to%20add%20a%20Listen%20and%20move%20the%20code%20into%20there%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-203392%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-203392%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20far%20as%20i%20know%20from%20your%20WF%20picture%2C%20its%20a%20sequential%20workflow%20you%20wanna%20execute.%3C%2FP%3E%3CP%3Eand%20the%20one%20Devendra%20is%20suggesting%20about%20the%20SP%202013%20based%20WF%20engine%20that%20doesnt%20have%20any%20C%23%20code.%3C%2FP%3E%3CP%3Eits%20purely%20declarative.%20so%2C%20the%20WF%20you%20have%20created%20is%20will%20generate%20a%20WSP%2Calong%20with%20DLL%20and%20deploy%20the%20wsp%20onto%20your%20solution%20store.%20This%20is%20the%20traditional%20approach%20we%20followed%20till%20the%20advent%20of%26nbsp%3B%20SP%202013.%3C%2FP%3E%3CP%3ESo%2C%20you%20can%20use%20any%20activity%20that's%20applicable%20in%20MOSS%202007%20WF%2C%20SP%202010%20WF%20Visual%20studio%20workflows.%3C%2FP%3E%3CP%3EEither%20you%20can%20use%20%26nbsp%3Bsequential%20or%20state%20machin%20WF.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSTRONG%3ESPWorkflowAssociation%26nbsp%3B%2C%20SPQurey%3C%2FSTRONG%3E%20are%20the%20object%20thats%20used%20extensively%20in%20SSOM(Server%20Side%20Object%20Model).%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EBut%20do%20not%20mix%20this%20with%20the%20SP%202013%20declarative%20WF.%20if%20you%20try%20this%20type%20of%20combining%20a%20declarative%20SP%202013%20WF%20with%20the%20old%20SP%202010%2F%20MOSS%202007%20Sequential%20WF%20%2FState%20machine%20%2C%20then%20it%20will%20fail.%3C%2FP%3E%3CP%3EThe%20workflow%20you%20have%20created%20will%20work%20only%20in%20the%20ON-PREM%20environment.%20you%20cant%20execute%20code%20against%20a%20SPO%20site.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-203344%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-203344%22%20slang%3D%22en-US%22%3E%3CP%3EMay%20be%20am%20deviating%20from%20the%20topic.%20if%20i%20wanna%20connect%20to%20a%20Oracle%20DataSource%20from%20SPList%2C%20from%20my%20SPO%20site%2C%20what%20are%20the%20ways%20to%20achieve%20this%3F%3C%2FP%3E%3CP%3Eif%20I%20use%20MSFlow%2C%20will%20it%20be%20helpful%20%3F%3C%2FP%3E%3CP%3Eif%20I%20use%20custom%20SP%20D%20WF%20%2C%20how%20to%20make%20calls%20to%20manipulate%20Oracle%20Data%3F%3C%2FP%3E%3CP%3EHow%20to%20use%20BCS%20connectivity%20in%20SPO%20%3F%20is%20it%20possible%20to%20connect%20Oracle%20DataSource%20using%20BCS%20in%20%26nbsp%3BSPO%20using%20SPD%202013%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-203293%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-203293%22%20slang%3D%22en-US%22%3EAlso...%20I%20can't%20do%20anything%20in%20Azure%20since%20the%20projects%20we%20support%20are%20government.%20They%20frown%20against%20the%20cloud.%20%3A(%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202862%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202862%22%20slang%3D%22en-US%22%3E%3CP%3ESorry%20that%20I%20appear%20so%20confused.%26nbsp%3B%20I%20GREATLY%20appreciate%20your%20desire%20to%20help.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Project.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35736i43B5DF68CDF52FBE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Project.png%22%20alt%3D%22Project.png%22%20%2F%3E%3C%2FSPAN%3EAttached%20is%20a%20screenshot%20of%20our%20solution.%26nbsp%3B%20The%20current%20screen%20represents%20our%20Workflow.%26nbsp%3B%20As%20you%20can%20see%2C%20we%20essentially%20create%20the%20workflow%20object%20and%20then%26nbsp%3Bit%20calls%20our%20custom%20code.%26nbsp%3B%20All%20of%20our%20workflows%20are%20from%20Visual%20Studio%20and%20are%20executing%20C%23%20objects%20that%20we%20have%20created%20through%20this%20path.%26nbsp%3B%20None%20are%20via%20SharePoint%20Designer.%26nbsp%3B%20Our%20custom%20code%20block%20executes%3B%20however%2C%20through%20the%20workflow%20container%20it%20times%20out%20in%2020%20minutes%20or%20so.%26nbsp%3B%20%26nbsp%3BAs%20you%20can%20see%2C%20I%20added%20an%20Activities%20folder%20under%20Workflows%20which%20is%20a%20%22Workflow%20Custom%20Activity%22.%26nbsp%3B%20The%20questions%20that%20I%20have%20are%20the%20following.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%26nbsp%3B%20I%20see%20the%20WaitForCustomEvent%20in%20the%20%22Workflow%20Custom%20Activity%22.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22WaitForCustomEvent.png%22%20style%3D%22width%3A%20228px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35737i84EACA91595B5A93%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22WaitForCustomEvent.png%22%20alt%3D%22WaitForCustomEvent.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EDo%20I%20need%20to%20move%20everything%20that%20is%20in%20the%20JEMSWorkerProcess%20to%20the%20NEW%20%22Workflow%20Custom%20Activity%20%5C%20ExecuteActions%22%20and%20then%20call%20it%20differently%20from%20the%20client%3F%26nbsp%3B%20Or%2C%20can%20I%20call%20this%20from%20the%20JEMSWorkerProcess.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20prevent%20myself%20from%20having%20to%20redo%20A%20LOT%20or%20work.%26nbsp%3B%20The%20JEMSWorkerProcess%20implementation%20works.%26nbsp%3B%20It%20just%20won't%20allow%20for%20long%20runs%20greater%20than%2020%20minutes.%26nbsp%3B%20If%20I%20could%20extend%20that%20it%20would%20be%20great.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECurrently%20we%20create%20the%20WF%20with...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%2F%2F%20Retrieve%20sharepoint%20list%20item%20based%20on%20Project%20name%20%2F%20folder%20name%20for%20workflow%20instantiation%3CBR%20%2F%3ESPQuery%20query%20%3D%20new%20SPQuery()%3B%3CBR%20%2F%3Equery.ViewAttributes%20%3D%20%22Scope%3D%5C%22RecursiveAll%5C%22%22%3B%3CBR%20%2F%3Equery.Query%20%3D%20%22%3CWHERE%3E%3CEQ%3E%3CFIELDREF%20name%3D%22'FileLeafRef'%2F%22%3E%3CVALUE%20type%3D%22'File'%22%3E%22%20%2B%20topFolderStr%20%2B%20%22%3C%2FVALUE%3E%3C%2FFIELDREF%3E%3C%2FEQ%3E%22%3B%3CBR%20%2F%3Equery.RowLimit%20%3D%201%3B%3CBR%20%2F%3Equery.ViewFields%20%3D%20%22%22%3B%3CBR%20%2F%3ESPListItemCollection%20items%20%3D%20taskOrderDocList.GetItems(query)%3B%3CBR%20%2F%3ESPListItem%20item%20%3D%20items%5B0%5D%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F%2Finstantiate%20JEMSWorkerProcess%20workflow%20based%20on%20the%20scenario%20folder%3CBR%20%2F%3ESPWorkflowAssociation%20workflowAssociation%20%3D%20taskOrderDocList.WorkflowAssociations.GetAssociationByName(Constants.Workflow.JEMSWORKERPROCESS_UNIQUENAME%2C%3CBR%20%2F%3ESystem.Globalization.CultureInfo.CurrentCulture)%3B%3CBR%20%2F%3E%2F%2Fpass%20in%20the%20currentstepID%20so%20that%20the%20actions%20can%20be%20retreived%20by%20sp%20workflow%20for%20the%20step.%3CBR%20%2F%3Estring%20eventData%20%3D%20string.Format(%22%3CINITDATA%3E%22%20%2B%20invokeType.ToString()%20%2B%20%22%2C%22%20%2B%20taskOrderID.ToString()%20%2B%20%22%2C%22%20%2B%20scenario.ToString()%20%2B%20%22%3C%2FINITDATA%3E%22)%3B%3CBR%20%2F%3ESPWorkflow%20wf%20%3D%20SPContext.Current.Site.WorkflowManager.StartWorkflow(item%2C%20workflowAssociation%2C%20eventData%2C%20SPWorkflowRunOptions.Asynchronous)%3B%3C%2FWHERE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20have%20to%20rewrite%20everything%20an%20move%20it%20to%20a%20%22Workflow%20Custom%20Activity%22%20that%20is%20a%20BIG%20effort%20and%20learning%20curve.%26nbsp%3B%20So%2C%20I%20am%20trying%20to%20get%20a%20pulse%20on%20what%20I%20am%20up%20against.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20change%20to%20a%20Custom%20Activity%20is%20it%20going%20to%20be%20something%20like...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ESPQuery%20query%20%3D%20new%20SPQuery()%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Equery.ViewAttributes%20%3D%20%22Scope%3D%5C%22RecursiveAll%5C%22%22%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Equery.Query%20%3D%20%22%3CWHERE%3E%3CEQ%3E%3CFIELDREF%20name%3D%22'FileLeafRef'%2F%22%3E%3CVALUE%20type%3D%22'File'%22%3E%22%20%2B%20topFolderStr%20%2B%20%22%3C%2FVALUE%3E%3C%2FFIELDREF%3E%3C%2FEQ%3E%22%3B%3C%2FWHERE%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Equery.RowLimit%20%3D%201%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Equery.ViewFields%20%3D%20%22%22%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ESPListItemCollection%20items%20%3D%20taskOrderDocList.GetItems(query)%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ESPListItem%20item%20%3D%20items%5B0%5D%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Estring%20eventData%20%3D%20string.Format(%22%3CINITDATA%3E%22%20%2B%20invokeType.ToString()%20%2B%20%22%2C%22%20%2B%20taskOrderID.ToString()%20%2B%20%22%2C%22%20%2B%20scenario.ToString()%20%2B%20%22%3C%2FINITDATA%3E%22)%3B%3CBR%20%2F%3EClientContext%20ctx%20%3D%20new%20ClientContext(SPContext.Current.Site.Url)%3B%3CBR%20%2F%3EWorkflowServicesManager%20workflowServiceManager%20%3D%20new%20WorkflowServicesManager(ctx%2C%20ctx.Web)%3B%3CBR%20%2F%3Evar%20workflowInstanceService%20%3D%20workflowServiceManager.GetWorkflowInstanceService()%3B%3CBR%20%2F%3Evar%20workflowInstances%20%3D%20workflowInstanceService.EnumerateInstancesForListItem(taskOrderDocList.ID%2C%20item.ID)%3B%3CBR%20%2F%3Ectx.Load(workflowInstances)%3B%3CBR%20%2F%3Ectx.ExecuteQuery()%3B%3CBR%20%2F%3EworkflowInstanceService.PublishCustomEvent(workflowInstances%5B0%5D%2C%20%22ProcessActions%22%2C%20eventData)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%26nbsp%3B%20Is%20there%20a%20way%20to%20extend%20the%20JEMSWorkerProcess%20execution%20that%20is%20just%20a%20%22Workflow%22%20instead%20of%20a%20%22Workflow%20Custom%20Activity%22%3F%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20I%20really%20want%20is%20the%20easiest%20way%20for%20my%20custom%20code%20in%20JEMSWorkerProcess%20to%20run%20longer%2C%20and%20for%20me%20to%20have%20total%20control%20over%20that%20length.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202468%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202468%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F153280%22%20target%3D%22_blank%22%3E%40Craig%20Lamb%3C%2FA%3E%3C%2FP%3E%0A%3CP%3ESharePoint%202013%20or%20SharePoint%202016%20Workflows%20are%20declarative%20but%20you%20can%20make%20web%20service%20calls%20from%20these%20workflows%20to%20execute%20the%20code.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20need%20to%20double-click%20on%20each%20state%20in%20the%20workflow%26nbsp%3Bto%20know%20more%20it.%20This%20app%20user%20association%20form.%20I%20am%20adding%20few%20screenshots%20for%20your%20reference.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20you%20can%20see%20how%20the%20delay%20activity%20was%20added.%20The%20last%20screenshot%20you%20can%20see%20how%20the%20HTTP%20activity%20used%20to%20make%20a%20call%20to%20external%20web%20service.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workflow-3.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35685iFC73D2A75EBFD828%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workflow-3.PNG%22%20alt%3D%22Workflow-3.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workflow-4.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35688iBA29E017062D05A5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workflow-4.PNG%22%20alt%3D%22Workflow-4.PNG%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workflow-5.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35686i8300FF1075B8B4DC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workflow-5.PNG%22%20alt%3D%22Workflow-5.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workflow-6.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35687iEFE10754938A913E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workflow-6.PNG%22%20alt%3D%22Workflow-6.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20create%20a%20custom%20workflow%20activity%20using%20visual%20studio%20and%20it%20will%26nbsp%3Bbe%20available%20automatically%20in%20the%20toolbox%20as%20part%20of%20the%20solution.%20Please%20let%20me%20know%20if%20you%20still%20have%20questions.%20Thanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202462%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202462%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Craig%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20the%20C%23%20code%20for%202013%20Workflow%20the%20fleetmanagementApp.%20Did%20you%20look%20at%20this%20one%3F%20This%20one%20shows%20how%20to%20tie%20the%20WaitForCustomEvent%20to%20the%20workflow.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcode.msdn.microsoft.com%2Fofficeapps%2FSharePoint-2013-Route-25a25d87%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fcode.msdn.microsoft.com%2Fofficeapps%2FSharePoint-2013-Route-25a25d87%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202461%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202461%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F115984%22%20target%3D%22_blank%22%3E%40Prasad%20Punneri%3C%2FA%3E%2C%20SharePoint%202016%20uses%20same%20WF%20engine%20as%20SharePoint%202013.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202330%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202330%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20the%20new%202016%20Workflow%20engine%20different%20from%20SP%202013%20Workflow%20engine%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-202290%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-202290%22%20slang%3D%22en-US%22%3E%3CP%3EI%20went%20through%20and%20looked%20at%20this%20yesterday.%26nbsp%3B%20I%20am%20struggling%20with%20a%20few%20things.%3C%2FP%3E%3CP%3EThe%20example%20doesn't%20have%20any%20CS%20files%20so%20I%20am%20unable%20to%20following%20in%20the%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOur%20workflow%20is%20fully%20from%20Visual%20Studio%20so%20we%20don't%20use%20SharePoint%20designer%20for%20much.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20also%20looked%20at%20the%20following%20link...%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Froykim.ca%2F2013%2F08%2F17%2Fsharepoint-2013-workflow-integration-with-the-waitforcustomevent-activity%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Froykim.ca%2F2013%2F08%2F17%2Fsharepoint-2013-workflow-integration-with-the-waitforcustomevent-activity%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20able%20to%20create%20'Workflow%20Custom%20Activity'%20and%20add%20a%20wait%20action%3B%20however%2C%20I%20was%20unable%20to%20determine%20how%20to%20call%20from%20Visual%20Studio%20or%20integrate%20with%20my%20existing%20SharePoint%20workflow%20in%20Visual%20Studio.%26nbsp%3B%20I%20was%20able%20to%20determine%20that%20though%20the%20following%20is%20provided...%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22pln%22%3Estsadm%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eo%20setproperty%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Epn%20workflow%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Eeventdelivery%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Etimeout%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Epv%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E30%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%22%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3EIt's%20not%20honored.%26nbsp%3B%20I%20changed%20the%20value%20to%2060%20and%20it%20only%20allowed%20the%20WF%20to%20run%20for%20about%2020%20minutes.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20currently%20thinking%20that%20I%20need%20to%20create%20a%20'Workflow%20Custom%20Activity'%20but%20I%20don't%20see%20how%20to%20tie%20it%20to%20my%20existing%20workflows.%26nbsp%3B%20If%20I%20can't%2C%20and%20it's%20something%20I%20call%20from%20my%20client%20that's%20fine.%26nbsp%3B%20However%2C%20that%20will%20result%20in%20some%20hefty%20code%20changes.%26nbsp%3B%20Currently%20trying%20to%20just%20create%20the%20'Workflow%20Custom%20Activity'%20place%20the%20WaitEvent%20on%20it%20and%20then%20call%20and%20see%20if%20it%20hits%20the%20break%20points%20I%20desire.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-201824%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-201824%22%20slang%3D%22en-US%22%3E%3CP%3EThanks.%26nbsp%3B%20I'll%20take%20a%20look.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-201578%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-201578%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F153280%22%20target%3D%22_blank%22%3E%40Craig%20Lamb%3C%2FA%3E%26nbsp%3BIf%20you%20look%20at%20the%20code%20published%20by%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F47093%22%20target%3D%22_blank%22%3E%40Andrew%20Connell%3C%2FA%3E%26nbsp%3B%20%3CA%20href%3D%22https%3A%2F%2Fcode.msdn.microsoft.com%2Fofficeapps%2FSharePoint-2013-Route-25a25d87%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%20%3C%2FA%3E%2C%20all%20your%20questions%20will%20be%20cleared.%20I%20am%20adding%20a%20couple%20of%20screenshots%26nbsp%3Bfor%20your%20reference.%20Please%20let%20me%20know%20if%20you%20still%20have%20questions.%20Thanks.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workflow-1.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35530iFC85C6B31A974D24%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workflow-1.PNG%22%20alt%3D%22Workflow-1.PNG%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workflow-2.PNG%22%20style%3D%22width%3A%20996px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35531i27820DBF6DD1A424%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workflow-2.PNG%22%20alt%3D%22Workflow-2.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-201554%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-201554%22%20slang%3D%22en-US%22%3E%3CP%3EOr...%26nbsp%3B%20have%20we%20gone%20about%20things%20wrong%20in%20that%20a%20Workflow%20Custom%20Activity%20is%20what%20we%20need%20to%20call%20from%20the%20page%20instead%20of%20a%20SharePoint%20workflow%3F%26nbsp%3B%20Thus%20Workflows%20are%20small%20and%20light%20weight%20while%20Workflow%20Custom%20Activities%20are%20for%20heavy%20lifting%20and%20larger%20tasks.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%20do%20I%20need%20both...%26nbsp%3B%20and%20a%20Workflow%20Custom%20Activity%20is%20something%20called%20from%20a%20Share%20Point%20Workflow%20to%20process%20the%20larger%20tasks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20for%20all%20the%20questions.%26nbsp%3B%20I%20am%20finding%20that%20there%20appears%20to%20be%20little%20information%20on%20this%2C%20and%20that%20you%20appear%20to%20be%20one%20of%20the%20few%20experts.%26nbsp%3B%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-201469%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-201469%22%20slang%3D%22en-US%22%3E%3CP%3ECurrently%20our%20workflows%20are%20quite%20minimal.%26nbsp%3B%20They%20are%20essentially%20just%20a%20queue%20of%20Actions%20to%20be%20performed%20in%20a%20desired%20order.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20is%20the%20idea%20to...%3C%2FP%3E%3CP%3E1.%26nbsp%3B%20Create%20the%20event%20and%20wrap%20all%20the%20Action%20processing%20in%20it.%3C%2FP%3E%3CP%3E2.%26nbsp%3B%20Then%20call%20it%20from%20the%20workflow%20so%20that%20it%20all%20this%20processes%20is%20executed%20outside%20of%20WF.%3C%2FP%3E%3CP%3E3.%26nbsp%3B%20Then%20once%20completed%20WF%20advances%20to%20the%20next%20step.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20the%20difference%20in%20that%20this%20will%20move%20the%20processing%20from%20the%20WF%20to%20the%20Service%20or%20site%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-201186%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-201186%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F153280%22%20target%3D%22_blank%22%3E%40Craig%20Lamb%3C%2FA%3E%26nbsp%3BSharePoint%202016%20uses%20new%20workflow%20engine.%20You%20can%20check%20the%20blog%20post%20%3CA%20href%3D%22http%3A%2F%2Fwww.andrewconnell.com%2Fblog%2Fpublishing-custom-events-to-sharepoint-2013-workflows%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%20%3C%2FA%3Eon%20how%20to%20use%26nbsp%3BCustom%20Events%20for%20Long%20Running%20External%20Processes.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-201098%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Workflows%3A%20%20Extend%20Timeout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-201098%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20try%20WaitforCustomEvent%20activity%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.sharepoint.workflowservices.activities.waitforcustomevent.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.sharepoint.workflowservices.activities.waitforcustomevent.aspx%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fwww.andrewconnell.com%2Fblog%2Fpublishing-custom-events-to-sharepoint-2013-workflows%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.andrewconnell.com%2Fblog%2Fpublishing-custom-events-to-sharepoint-2013-workflows%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

How do I extend the execution time of a SharePoint workflow?  Currently we are concerned with SharePoint 2016 Workflows.  It appears to be running for around 20 minutes and then terminates.  The events that we have associated to it are terminating at random locations.  The code works outside of workflow and for shorter running processes.  So, we are thinking timeout.

 

We have executed the following in an attempt to extend workflow to 30 minutes.

stsadm -o setproperty -pn workflow-eventdelivery-timeout -pv "30"

 

Is there something else that we can do, or that I am missing, to extend this?  We can attempt reconfiguration to make things run shorter; however, I would like to have control over how long things can run.  I don't want to limit the process, but be able to lengthen it if needed.

 

Thanks,

Craig

20 Replies
Highlighted
Solution

@Craig Lamb SharePoint 2016 uses new workflow engine. You can check the blog post here on how to use Custom Events for Long Running External Processes.

Highlighted

Currently our workflows are quite minimal.  They are essentially just a queue of Actions to be performed in a desired order. 

 

So, is the idea to...

1.  Create the event and wrap all the Action processing in it.

2.  Then call it from the workflow so that it all this processes is executed outside of WF.

3.  Then once completed WF advances to the next step.

 

Is the difference in that this will move the processing from the WF to the Service or site?

Highlighted

Or...  have we gone about things wrong in that a Workflow Custom Activity is what we need to call from the page instead of a SharePoint workflow?  Thus Workflows are small and light weight while Workflow Custom Activities are for heavy lifting and larger tasks.  

 

Or do I need both...  and a Workflow Custom Activity is something called from a Share Point Workflow to process the larger tasks.

 

Sorry for all the questions.  I am finding that there appears to be little information on this, and that you appear to be one of the few experts.  :)

Highlighted

@Craig Lamb If you look at the code published by @Andrew Connell  here , all your questions will be cleared. I am adding a couple of screenshots for your reference. Please let me know if you still have questions. Thanks.

 

Workflow-1.PNGWorkflow-2.PNG

Highlighted

Thanks.  I'll take a look.

Highlighted

I went through and looked at this yesterday.  I am struggling with a few things.

The example doesn't have any CS files so I am unable to following in the code.

 

Our workflow is fully from Visual Studio so we don't use SharePoint designer for much.  

I have also looked at the following link...

https://roykim.ca/2013/08/17/sharepoint-2013-workflow-integration-with-the-waitforcustomevent-activi...

 

I was able to create 'Workflow Custom Activity' and add a wait action; however, I was unable to determine how to call from Visual Studio or integrate with my existing SharePoint workflow in Visual Studio.  I was able to determine that though the following is provided...

stsadm -o setproperty -pn workflow-eventdelivery-timeout -pv "30"

It's not honored.  I changed the value to 60 and it only allowed the WF to run for about 20 minutes.

 

I am currently thinking that I need to create a 'Workflow Custom Activity' but I don't see how to tie it to my existing workflows.  If I can't, and it's something I call from my client that's fine.  However, that will result in some hefty code changes.  Currently trying to just create the 'Workflow Custom Activity' place the WaitEvent on it and then call and see if it hits the break points I desire.  

Highlighted

Is the new 2016 Workflow engine different from SP 2013 Workflow engine?

Highlighted

@Prasad Punneri, SharePoint 2016 uses same WF engine as SharePoint 2013. 

Highlighted

Hello Craig

 

Here's the C# code for 2013 Workflow the fleetmanagementApp. Did you look at this one? This one shows how to tie the WaitForCustomEvent to the workflow.

 

https://code.msdn.microsoft.com/officeapps/SharePoint-2013-Route-25a25d87

 

Thanks

 

 

Highlighted

@Craig Lamb

SharePoint 2013 or SharePoint 2016 Workflows are declarative but you can make web service calls from these workflows to execute the code. 

You need to double-click on each state in the workflow to know more it. This app user association form. I am adding few screenshots for your reference.

 

Here you can see how the delay activity was added. The last screenshot you can see how the HTTP activity used to make a call to external web service.

Workflow-3.PNG

Workflow-4.PNGWorkflow-5.PNG

Workflow-6.PNG

 

You can create a custom workflow activity using visual studio and it will be available automatically in the toolbox as part of the solution. Please let me know if you still have questions. Thanks.

Highlighted

Sorry that I appear so confused.  I GREATLY appreciate your desire to help.

Project.pngAttached is a screenshot of our solution.  The current screen represents our Workflow.  As you can see, we essentially create the workflow object and then it calls our custom code.  All of our workflows are from Visual Studio and are executing C# objects that we have created through this path.  None are via SharePoint Designer.  Our custom code block executes; however, through the workflow container it times out in 20 minutes or so.   As you can see, I added an Activities folder under Workflows which is a "Workflow Custom Activity".  The questions that I have are the following.

 

1.  I see the WaitForCustomEvent in the "Workflow Custom Activity".  

WaitForCustomEvent.png

Do I need to move everything that is in the JEMSWorkerProcess to the NEW "Workflow Custom Activity \ ExecuteActions" and then call it differently from the client?  Or, can I call this from the JEMSWorkerProcess.

 

I am trying to prevent myself from having to redo A LOT or work.  The JEMSWorkerProcess implementation works.  It just won't allow for long runs greater than 20 minutes.  If I could extend that it would be great.

 

Currently we create the WF with...

 

// Retrieve sharepoint list item based on Project name / folder name for workflow instantiation
SPQuery query = new SPQuery();
query.ViewAttributes = "Scope=\"RecursiveAll\"";
query.Query = "<Where><Eq><FieldRef Name='FileLeafRef'/><Value Type='File'>" + topFolderStr + "</Value></Eq></Where>";
query.RowLimit = 1;
query.ViewFields = "";
SPListItemCollection items = taskOrderDocList.GetItems(query);
SPListItem item = items[0];

//instantiate JEMSWorkerProcess workflow based on the scenario folder
SPWorkflowAssociation workflowAssociation = taskOrderDocList.WorkflowAssociations.GetAssociationByName(Constants.Workflow.JEMSWORKERPROCESS_UNIQUENAME,
System.Globalization.CultureInfo.CurrentCulture);
//pass in the currentstepID so that the actions can be retreived by sp workflow for the step.
string eventData = string.Format("<initData>" + invokeType.ToString() + "," + taskOrderID.ToString() + "," + scenario.ToString() + "</initData>");
SPWorkflow wf = SPContext.Current.Site.WorkflowManager.StartWorkflow(item, workflowAssociation, eventData, SPWorkflowRunOptions.Asynchronous);

 

If I have to rewrite everything an move it to a "Workflow Custom Activity" that is a BIG effort and learning curve.  So, I am trying to get a pulse on what I am up against. 

 

If I change to a Custom Activity is it going to be something like...

 

SPQuery query = new SPQuery();
query.ViewAttributes = "Scope=\"RecursiveAll\"";
query.Query = "<Where><Eq><FieldRef Name='FileLeafRef'/><Value Type='File'>" + topFolderStr + "</Value></Eq></Where>";
query.RowLimit = 1;
query.ViewFields = "";
SPListItemCollection items = taskOrderDocList.GetItems(query);
SPListItem item = items[0];

string eventData = string.Format("<initData>" + invokeType.ToString() + "," + taskOrderID.ToString() + "," + scenario.ToString() + "</initData>");
ClientContext ctx = new ClientContext(SPContext.Current.Site.Url);
WorkflowServicesManager workflowServiceManager = new WorkflowServicesManager(ctx, ctx.Web);
var workflowInstanceService = workflowServiceManager.GetWorkflowInstanceService();
var workflowInstances = workflowInstanceService.EnumerateInstancesForListItem(taskOrderDocList.ID, item.ID);
ctx.Load(workflowInstances);
ctx.ExecuteQuery();
workflowInstanceService.PublishCustomEvent(workflowInstances[0], "ProcessActions", eventData);

 

2.  Is there a way to extend the JEMSWorkerProcess execution that is just a "Workflow" instead of a "Workflow Custom Activity"?  

 

All I really want is the easiest way for my custom code in JEMSWorkerProcess to run longer, and for me to have total control over that length.

Highlighted
Also... I can't do anything in Azure since the projects we support are government. They frown against the cloud. :(
Highlighted

May be am deviating from the topic. if i wanna connect to a Oracle DataSource from SPList, from my SPO site, what are the ways to achieve this?

if I use MSFlow, will it be helpful ?

if I use custom SP D WF , how to make calls to manipulate Oracle Data?

How to use BCS connectivity in SPO ? is it possible to connect Oracle DataSource using BCS in  SPO using SPD 2013 ?

Highlighted

As far as i know from your WF picture, its a sequential workflow you wanna execute.

and the one Devendra is suggesting about the SP 2013 based WF engine that doesnt have any C# code.

its purely declarative. so, the WF you have created is will generate a WSP,along with DLL and deploy the wsp onto your solution store. This is the traditional approach we followed till the advent of  SP 2013.

So, you can use any activity that's applicable in MOSS 2007 WF, SP 2010 WF Visual studio workflows.

Either you can use  sequential or state machin WF. 

SPWorkflowAssociation , SPQurey are the object thats used extensively in SSOM(Server Side Object Model).

But do not mix this with the SP 2013 declarative WF. if you try this type of combining a declarative SP 2013 WF with the old SP 2010/ MOSS 2007 Sequential WF /State machine , then it will fail.

The workflow you have created will work only in the ON-PREM environment. you cant execute code against a SPO site.

 

Highlighted
Thank you soooo much. This helps and is getting me more on track.
So, I just need to add a Listen and move the code into there?
Highlighted

@Craig Lamb

Let me know, whats your environment, is it ON-PREM or O 365-SPO and whats you exact requirement .

If its ON-PREM you have the freedom to play along with the rich set of SSOM APIs.you can have a look at the SharePoint's social.msdn forum that has dedicated workflow related categories and source code available . Myself too posted many answers specific to workflow,- whether its sequential or state machine.

If its SPO Env,you have to look at declarative workflows mentioned by Devendra @Devendra Velegandla .

 

 

 

Highlighted
It's on PREM. All of our WFE's are on PREM due to government and contract constraints. We are running 2013 and 2016 SharePoint. We are creating WSP's and installing on each PROD deploy, etc. All the code works out of workflow and in. It's just with the large datasets it is terminating after about 20 minutes.

As noted above, we attempted the following...
stsadm -o setproperty -pn workflow-eventdelivery-timeout -pv "45"

SharePoint let is do it and we see the value stored; however, it's not honoring. I am just trying to find the easiest way to get SharePoint to honor our WF's for more time without having to redo everything. That would negate 3 years of confidence, field validation, etc.
Highlighted

@Craig Lamb whether the task list associated with your splist is crossed the threshold of 5K items ?

Do you have managed metadata  columns(taxonomy) associated with workflow ?

Do you have more than 8 lookup columns or people picker columns in your SourceList?

Have you used content types in your workflow? if yes,how  these content types are deployed( the best practice is to deploy the content type& workflow as a feature ) at the site level and activate it in Order ( this activation /deactivation of feature should be in a specific order else, WF will fail).

There may be many reason for your WF termination.

Did you analyse logs folder/log files through which you may get a hint, whats happening in the Env.? <p>

One more thing you can try, in the workflow, you can add a logtohistoryactivity and log all these actions,write into an text file, thus, you will be able to track the source of error. At what point , its failing.  Or simply a codeactivity and inside this codeactivity, you write the values,into a text file.  

it may also be important that, any of the columns in your soucelist is accidentally deleted by your teammembers and they recreated thus the internal name in the CAML query might have changed...