Tips & Tricks
Automatic Backup of Podio Workflow Automation Flows
App Builder & Automation Expert
Stay Updated with ProcFu!
Subscribe to our newsletter for the latest tips, updates, and automation insights.
Subscribe NowThis guide outlines how to set up an automated script to regularly back up your PWA flows to a Podio app. This ensures you have a secure and organized record of your workflows in case of any issues.
Requirements
- A Podio account with a custom app created specifically for storing your PWA flows.
- A ProcFu account.
Setting Up Your Podio App
Create an App
In Podio, create a new app to store your flow data.
Define Fields
Within your app, create the following text fields with the corresponding IDs:
- Flow ID (ID: flow-id)
- Flow Name (ID: flow-name)
- Description (ID: description)
- Trigger Type (ID: trigger-type)
- Version (ID: version)
- Flow Data (ID: flow-data)
Creating the ProcFu Script
Go to ProcFu Custom Code and create a new script with the following code:
$app_id = "29860573";
$flow_id_field_id = "266749145";
$flow_list = pwa_flows_list();
foreach ($flow_list as $flow) {
$flow_id = find_in_json($flow,"pkFlows");
$flow = pwa_flow_get($flow_id);
$fields = [
"flow-id" => json_encode($flow_id),
"flow-name" => json_encode($flow["flow"]["flowName"]),
"description" => json_encode($flow["flow"]["description"]),
"trigger-type" => json_encode($flow["flow"]["triggerType"]),
"version" => json_encode($flow["flow"]["version"]),
"flow-data" => json_encode($flow)
];
$exists = podio_app_search($app_id,$flow_id_field_id,$flow_id,"E",1,1);
if($exists[0]){
$fields["flow-name"] = $fields["flow-name"];
podio_item_fields_update($exists[0]["item_id"],json_encode($fields),0,0);
} else {
podio_item_create($app_id,json_encode($fields),0,0)
}
}
account_logger_log("Flow Backup Complete");
Replace the following placeholders with your actual values:
- $app_id: Your Podio app ID (e.g., 29860573).
- $flow_id_field_id: The ID of the "Flow ID" field in your Podio app (e.g., 266749145).
Understanding the Script
- The script retrieves all your PWA flows.
- It iterates through each flow, checking if its ID already exists in Podio.
- If the ID exists, the script updates the corresponding Podio item with the latest flow data.
- If the ID is new, the script creates a new item in your Podio app with all the flow details.
- Finally, a log message is recorded to confirm successful backup completion.
Scheduling Backups
ProcFu Scheduled Tasks: ProcFu offers a Scheduled Tasks feature. Use this to set up a recurring schedule for running your script. You can choose the frequency that best suits your needs (e.g., daily, weekly).
Conclusion
By following these steps, you can establish a reliable and automated system for backing up your PWA flows to Podio.