Scheduling your Automation
Create fully automated processes by scheduling your Python script to run on GitHub
Motivation
After you've used Mito to write Python code, you may want to schedule this code to execute on a repeated basis. Mito makes it incredibly easy to schedule a Python automation, automatically handling:
Automatic version control/documentation: Mito will place your automation and initial data files under version control, making sure that you never loose your work. Moreover, auto-generated documentation means your team can easily understand your automations.
Avoid breaking dependency updates: Mito will automatically detect what dependencies you're using, and freeze them for your automation. This makes sure future package changes don't break your code without your knowledge!
Avoid complex scheduling interfaces: Visually tell Mito the cadence to run your automation and let Mito handle generating cron job syntax, timezones, ensuring runners are available, and making sure all you need to do is download the result.
Where does my automation run?
Currently, Mito supports Github Actions as it's primary automation location. Mito will automatically open automation PRs against your selected repository.
How to schedule an automation:
Step 1: Create an Automations repository and configure it in Mito
Create a new Github repo. You can find instructions here.
Set the new Github Repo as the automation repository for Mito, using environmental variables.
Step 2: Create a personal access token, and add it to your environment
Create a Github Token, following the instructions here. It will look something like
"ghp_thisisarandomstringoflettersandnumbers"
Set the Github Token as an environmental variable wherever you are running Mito.
Step 3: Use the Schedule Automation interface in the Code
tab
Code
tabSelect
Code > Schedule Automation
Give the automation a descriptive
Automation Name
andAutomation Description
. The Automation Name will become the GitHub PR title and the Automation Description will be the PR description.Configure the
Automation Schedule
.Click
Schedule on Github
. Mito will create a new PR with the required input files, Python code, and GitHub action workflow. In a few moments the PR will be ready for review.
Step 4: Review and merge this PR
Review the code of this PR, making any necessary changes or updates
Merge this PR into the main branch to schedule the automation.
Step 5: Get the results of future automation runs
Go to the Github repo configured in Step 1.
Go to the
Actions
tab and select the action for this automation.Click on the most recent run for this automation.
Scroll down, and download the
results
artifact. This will contain the results of the automation. If there is noresults
artifact, this is likely because you did not export any files in your generated code.
Last updated