This directory contains the core AO Lua modules and templates for the AO Process Builder.
- bots/ - Bot implementations (EmailBot, etc.)
- core/ - Core modules (ProcessBuilder, Utils, etc.)
- deploy/ - Deployment scripts
- tests/ - Test scripts
- Make sure you have the AO platform installed on your system
- Ensure you have the
aos
command available in your terminal - Make sure you have a stable internet connection
The easiest way to deploy the AO Process Builder is using the provided deployment script:
# Navigate to the deploy directory
cd deploy
# Make the deployment script executable
chmod +x deploy.sh
# Run the deployment script
./deploy.sh
The deployment script will:
- Start the AOS platform if it's not already running
- Load all necessary modules in the correct order
- Output the Process IDs for each component
- Save these Process IDs to a configuration file for later use
If you prefer to deploy manually or need more control over the process, follow these steps:
# Start AOS in a terminal window
aos
This will start the AOS platform and provide you with an interactive terminal.
# In the AOS terminal, load the Utils module
.load core/Utils.lua
After loading, you should see output similar to:
Loaded module: Utils
Process ID: <utils-process-id>
Make note of the Process ID as you'll need it later.
# Load the ProcessBuilder module
.load core/ProcessBuilder.lua
After loading, you should see output similar to:
Loaded module: ProcessBuilder
Process ID: <process-builder-id>
Make note of the ProcessBuilder ID as you'll need it for the backend integration.
# Load the EmailBot module
.load bots/EmailBot.lua
After loading, you should see output similar to:
Loaded module: EmailBot
Process ID: <email-bot-id>
Make note of the EmailBot ID as you'll need it for the backend integration.
To verify that all components are deployed correctly, you can check the process list:
# In the AOS terminal
.processes
You should see all the processes you've deployed listed with their IDs.
To ensure everything is working correctly, run a simple test:
# Load the simple test script
.load tests/SimpleTest.lua
You should see output indicating that the test has run successfully and the components are communicating with each other.
If you want to use custom automation templates:
# Load the basic automation template
.load core/AutomationTemplate.lua
# Load the advanced template with conditions
.load core/AdvancedTemplate.lua
To monitor the messages being sent to and from your processes:
# View the inbox of a specific process
.inbox <process-id>
# View a specific message
.view <message-number>
# Send a test message to a process
Send({
Target = "<process-id>",
Action = "<action-name>",
Data = "<your-data>"
})
To run the basic tests, use the test scripts in the tests/
directory:
# Start AOS if not already running
aos
# Load the simple test script
.load tests/SimpleTest.lua
For more comprehensive testing, you can use the ProcessBuilderTest script:
# Load the ProcessBuilder test script
.load ProcessBuilderTest.lua
This script will:
- Register handlers for various actions
- Send test messages to itself
- Process those messages and send responses
- Output detailed logs of the entire process
If you encounter issues during deployment or testing:
- Check that the AOS platform is running correctly
- Verify that all process IDs are valid
- Check the AOS logs for any error messages
- Try restarting the AOS platform and redeploying
- Ensure you're loading the modules in the correct order (Utils → ProcessBuilder → Bots)
When deploying to production:
- Always use the stable versions of the modules
- Make sure to securely store the process IDs
- Set up monitoring for the AOS platform
- Consider using a process manager to keep AOS running
- Regularly backup your process state