Custom Code Execution

This guide shows you how to add the Custom Code Execution tool to a Zaplane workflow, so you can run your own PHP code whenever your trigger fires.

Step 1: Create a Workflow

Go to Zaplane > Workflows from your WordPress dashboard, then click Create Workflow to open the workflow editor.

Before adding the Custom Code Execution tool, you need to set up a trigger first. Here is how to do it quickly:

Click Select an app under the Trigger box and choose Apps.
Search for and select the trigger app (in this guide we are using aBlocks Contact Form).
Choose the Trigger Type that matches the event you want, then click Continue.
On the Configure tab, set any required options, then click Continue.
On the Test tab, click Test Trigger to confirm it works, then click Save.

Once your trigger is saved, proceed to the next step to add the Custom Code Execution tool.

Step 2: Add an Action

Click the + button next to your trigger, then select Custom Code Execution in the Add Action panel.

Add an Action

Step 3: Choose the Action Type

Open the Action Type dropdown and pick the language you want to run. Custom Code Execution offers several action types, for example Execute PHP Code. Click Continue.

Choose the Action Type

Step 4: Configure the Action

On the Configure tab, enter your code in PHP Code. Data from previous steps is available as $input, and the value you return becomes this step’s output. You can also set Timeout (seconds) and Memory Limit (MB), then click Continue.

Configure the Action

Step 5: Test the Action

On the Test tab, click Test Action to run your code once. If it works, click Save.

Test the Action

Step 6: Update and Activate the Workflow

Back on the canvas, click Update to save your workflow and make sure the status is set to Active. Every time your trigger fires, Zaplane now runs your code automatically.

Update and Activate the Workflow

Done!

Your Custom Code Execution tool is added and ready to go.