End of Next Working Day via WorkflowSyntax NodeScriptWebModel

Hi

Is there C# function available that would return the end of next working day, or a set time on the next working day, or even just the next business day. (If it checks for UK holidays then even better)

Input:  DateTime = 2023-10-06T12:34Z

Return:  DateTime = 2023-10-09T23:59Z

Hello Howard,

You could look into WorkflowSyntaxNodeRelativeTimeWebModel, currently we only support system-set origin DateTimes (the input in what you’re describing basically) "Scheduled", "Triggered", and "Started" that are DateTimes that match the timestamp of the corresponding event of the Workflow you are running.

In v2.52.0, which will be released towards the end of this month if I’m not mistaken, we will also be supporting user-set origin DateTimes ("offsetOrigin": "Specified").

In your customer you can create a designs_workingDays item that specifies what days of the week are considered working days, and you can also create any specific holidays you want using designs_holidays.

Then in your workflow you can pass something like "offsetMilliseconds": 86400000 (24 hours in milliseconds) and it will return the next working day, taking into account the designs_workingDays item and any designs_holidays items you created.

Here’s an example of a Message Action that will send me the next working day, from the moment it’s triggered.

{
  "signature": "651e7758da2eb27c483e486e",
  "description": "Next Working Day SMS",
  "parameters": [
    {
      "attribute": {
        "attributeCode": "attributes_workflowMessageActionMessageType",
        "value": [
          "5c66bcd44b4d4259071069df"
        ]
      },
      "discriminator": "WorkflowConstantItemAttributeWebModel"
    },
    {
      "attributeCode": "attributes_workflowMessageActionMessageText",
      "value": {
        "discriminator": "WorkflowSyntaxNodeTemplateWebModel",
        "template": "$myCalculatedDateTime"
      },
      "discriminator": "WorkflowComputedItemAttributeWebModel"
    },
    {
      "attribute": {
        "attributeCode": "attributes_workflowMessageActionRecipientName",
        "value": "Niko"
      },
      "discriminator": "WorkflowConstantItemAttributeWebModel"
    },
    {
      "attribute": {
        "attributeCode": "attributes_workflowMessageActionMobileNumber",
        "value": "+447712345678"
      },
      "discriminator": "WorkflowConstantItemAttributeWebModel"
    }
  ],
  "variables": [
    {
      "name": "myCalculatedDateTime",
      "value": {
        "discriminator": "WorkflowSyntaxNodeRelativeTimeWebModel",
        "condition": {
          "workingDaysTimeConditionType": "OnWorkingDays"
        },
        "offsetMilliseconds": 86400000,
        "offsetOrigin": "Triggered"
      }
    }
  ]
}

Hi,

Thank you, that’s great to hear!

I’ll look forward to coming updates, since {“offsetOrigin”: “Specified”} sounds exactly what I was looking for.