In this meeting, Cameron is seeking advice on how to ensure that his background tasks run only in the appropriate environment (test or live). The suggestion given by the State Changer is to create a meta table with a DB type field that indicates the environment (prod or test). By doing a lookup to this table, Cameron can determine the environment and set a precondition to stop the task if it's not in the desired environment.
However, it is mentioned that background tasks may only run in the live environment. To work around this limitation and have background tasks run on the test environment, Cameron is advised to create an API endpoint and use headers to specify the desired environment. The background task can then kick off the API endpoint, which will execute the necessary function. The State Changer also discusses branching and versioning. It is explained that branching can be used to manage production processes and allows for different versions of the code to be run. However, it is recommended not to use branching unless working with someone who requires it for their process. For product engineering and prototyping, the manual approach of cloning workspaces and implementing code changes is suggested. Finally, Cameron asks about how to handle the versioning of API calls and whether he needs to manually update headers for each call. The State Changer confirms that headers can be used to call specific versions of API endpoints and suggests creating an input variable linked to the headers to make it more dynamic. Overall, the meeting provides guidance on managing background tasks, using headers for environment selection, and understanding when to use branching and versioning in Xano.
(Source: Office Hours 12/13 )
Join State Change Risk-Free