Skip to content

Calling `.includes()` on a string variable inside a workflow script task fails, even though the variable is confirmed to genuinely be a string.

Answer

String.includes() is an ES6 JavaScript feature that isn't supported by the workflow script task's JavaScript engine — use .indexOf() instead (checking for a result other than -1) to achieve the same substring-check behavior in a way the script task's engine actually supports.

← Browse Workflows and automation questions