# Tutorial 1: Create A Condition And Upload It

Typically every action requires a condition under which you want the action to execute, such as rebalancing a portfolio under the condition of time (e.g. every day), or making a trade under the condition of price (such as a limit order or stop loss). Some conditions are very common, such as time-based conditions, and the beauty of AutoStation is that, because you can mix and match any number of conditions with any number of actions, the **same** time conditions contract can be used with any other action or condition in a completely modular way!

This tutorial shows how to create a contract that is usable in AutoStation to add time conditions to any other action/condition. Since it's already created and uploaded to AutoStation, it's a bit pointless for anyone else to do it, but it shows every step required in the process so you can easily come up with your own condition and upload it to AutoStation. We're going to create a time-based condition contract that allows you to use 2 kinds of triggers/conditions:

1. At a specific time, e.g. "trigger on June 1st at 10am" (more suitable for non-recurring automations) - \`betweenTimes\`
2. Recurring with a constant time period "trigger starting on June 1st at 10am and every day after that" (obviously more suitable for recurring automations) - `everyTimePeriod`

Part 1 covers the specific time condition, and part 2 covers the recurring condition. The whole contract code can be found [here](https://github.com/Autonomy-Network/autostation-contracts/blob/develop/contracts/conditions/TimeConditions.sol).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autonomynetwork.io/autonomy-docs/autonomy-network/products/autostation/tutorial-conditions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
