Overview
The On Finish Trip automation event triggers when a field worker ends their trip using the MileApp Field mobile application. This event captures the completion of field operations, allowing you to automate post-trip workflows, generate reports, or integrate with external systems when a trip concludes.When Does This Event Trigger?
The “On Finish Trip” event is triggered when they tap the “End Trip” button and the trip end action is successfully recorded in the system.This event is mobile-app specific and can only be triggered from the MileApp Field application, not from the web portal. The field worker must have previously started a trip for this event to occur.
Prerequisites
Before setting up an automation with this event, ensure:- You have access to the Automation feature in MileApp
- You have appropriate permissions to create and manage automations
- Field workers are using the MileApp Field mobile application
- The “Start Trip - End Trip” feature is enabled in your organization settings
- Field workers have started trips that can be finished
Required permission:
- View Automation
- Create Automation
Use Cases
1. Post-Trip Task Creation
Scenario: Create administrative tasks after field work is completed (vehicle inspection, expense reporting). Configuration:- Event: On Finish Trip
- Automation Type: Create and Assign Task
- Action: Create “Submit Trip Expenses” task assigned to the field worker
2. Fleet Management Integration
Scenario: Update vehicle status and availability in fleet management system. Configuration:- Event: On Finish Trip
- Automation Type: Webhook
- Action: Update vehicle status to “Available” and log odometer reading
Setting Up On Finish Trip Automation
Step 1: Navigate to Automation Settings
- Log in to MileApp web portal
- Click on Flow in the main navigation
- Click on the Automation tab

Automation tab in Flow menu
Step 2: Create New Automation
- Click the New button in the Automation page
- The “Create Automation” dialog will appear

Create Automation dialog with event selection showing all available automation events
Step 3: Configure Automation Details
Fill in the following information:- Automation Name: Provide a descriptive name (e.g., “Generate Trip Summary on End”)
- Event: Select “On Finish Trip” from the dropdown
-
Automation Type: Choose the action type:
- Webhook - Send data to external URL
- Configure type-specific settings based on your chosen Automation Type
Step 4: Configure Webhook (If Selected)
If you selected “Webhook” as the Automation Type:- URL: Enter the endpoint URL where trip end data should be sent
- Header (Optional): Add custom HTTP headers if required (e.g., Authorization, Content-Type)
- Value (Optional): Provide corresponding header values
Step 5: Save and Activate
- Click Submit to create the automation
- Ensure the automation is set to Active (toggle enabled)
- Test the automation by having a field worker complete a trip
Webhook Payload Structure
When using the Webhook automation type with “On Finish Trip”, MileApp sends a POST request with the following data structure:duration field is in seconds.
Monitoring and Troubleshooting
Viewing Automation Logs
To verify your “On Finish Trip” automation is working correctly:- Go to Flow > Automation
- Find your automation in the list
- Click the clock history icon to view execution logs
- Review successful executions and any errors
Common Issues
Issue: Automation not triggering when trip ends Possible Causes:- Automation is not set to Active
- Field worker doesn’t have proper permissions
- End Trip feature is disabled in organization settings
- Trip was not properly started before ending
- Network connectivity issues on mobile device
- Verify automation is enabled (toggle is ON)
- Check user permissions in Settings > Permission
- Verify End Trip feature is enabled in Settings > Permission
- Ensure field workers start trips before ending them
- Ensure field workers have stable internet connection
- Trip data not fully synced before automation triggered
- Location services disabled on mobile device
- Tasks not properly marked as completed
- Ensure mobile app has synced all trip data before ending
- Verify location permissions are granted
- Check task completion status in trip logs
Related Documentation
- Automation Introduction
- Automation Type
- On Start Trip
- Start Trip - End Trip Configuration
- Webhook Automation
- Task Management