Skip to content

Hooks for Developers

FlowMint fires these actions and filters. Step types themselves cannot be added from outside the plugin.

HookTypeArgumentsWhen
fmw_workflow_run_startedActionrun id, workflow id, entry idA run begins.
fmw_workflow_run_completedActionrun id, workflow id, entry id, contextA run completes.
fmw_workflow_run_failedActionrun id, workflow id, entry id, error code, error messageA run is marked failed for good.
fmw_should_run_workflowFiltertrue, workflow id, entry idBefore the steps run. Return false to skip them; the run is marked completed.

The entry id is 0 for a scheduled run.

HookTypeArgumentsWhen
fmw_step_completedActionrun id, step name, step type, outputA step succeeds.
fmw_step_failedActionrun id, step name, step type, error code, messageA step fails, whatever its on_error.
fmw_step_outputFilteroutput, step object, contextBefore a step’s output is stored for later steps. The run history keeps the unfiltered output.
HookTypeArgumentsWhen
fmw_workflow_savedActionFMW_Workflow objectA workflow is created or updated.
fmw_workflow_disabledActionworkflow idAn update switches a workflow off.
fmw_workflow_deletedActionworkflow id, previous rowA workflow is deleted.
fmw_initActionplugin instanceFlowMint has started.
HookTypeArgumentsUse
fmw_logActionlevel, message, contextReceive every log message, for example to send it to a monitoring service.
fmw_log_min_levelFilterinfoLowest level written: debug, info, warning or error. Debug messages also need the FMW_DEBUG constant.
fmw_failure_notification_enabledFiltertrue, run id, workflow idReturn false to send no alert.
fmw_failure_notification_messageFiltermessage, run id, workflow id, entry id, error code, error messageChange the alert text.
fmw_credentialFilternull, keyReturn a value to use instead of the stored credential.
HookTypeArgumentsUse
fmw_retry_delay_secondsFilterdelay, attempt, run idSeconds before a retry. Default 60, 300, then 900.
fmw_run_time_limitFilter300Seconds of PHP time asked for each run.
fmw_interrupted_run_after_secondsFilter1800How long a run may stay RUNNING before it is treated as interrupted.
fmw_drive_upload_chunk_sizeFilter8 MB in bytesSize of each part of a large Drive upload, rounded to a multiple of 256 KB.
fmw_drive_http_clientFilternullReturn a Guzzle client to send every Google Drive request through, for testing a workflow without Google.
HookTypeArgumentsUse
flowmint_manage_workflows_capabilityFilterflowmint_manage_workflowsThe capability the REST API and connector check. The admin screens always check flowmint_manage_workflows.
flowmint_default_manage_workflows_rolesFilter['administrator']Roles given the capability on activation and on database upgrades.