Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

If workflow activity

The If activity checks a condition or script to determine if a Yes or No transition should be taken.

If the workflow creator specifies both the Condition and the Advanced script, both must evaluate successfully for activity to take the Yes transition.

Results

The workflow designer can assign a result value using activity.result from within the Script field on the activity record. By default, the result value of the activity is the final result of the condition or script specified. Possible result values are:

  • Yes
  • No

Input variables

The following variables determine the behavior of the activity.

Note: Condition activities run as the user whose actions match the conditions the workflow was waiting for and advances the workflow.

FieldDescription
ConditionIf specified and the current record matches the condition, the Yes transition is taken.
Advanced and ScriptTo specify a script, select the Advanced check box. You may then enter a script that is evaluated. If your script sets the variable answer to yes, then the Yes transition is taken. Otherwise, the No transition is taken.

Conditions

The following conditions determine which transition comes after the activity.

Condition 
YesTaken when the condition, if specified, matches and the Advanced script, if specified, returns yes.
NoTaken when either the condition does not match or the Advanced script, if specified, returns no.

States

The activity state tells the workflow engine what to do with the activity.

StateDescription
ExecutingThe workflow engine knows to start the onExecute function of the activity.
WaitingThe workflow engine ignores the activity until a specific event to restart the activity is fired.
FinishedThe activity finished running. See the result value for the outcome of the activity.
CancelledThis activity, or the workflow that contains this activty, was canceled.
ErrorA JavaScript error occurred. Review the logs for error details.