# Component

Components are the building blocks of Appmixer. Each component in a flow reacts on incoming messages, processes them and produces outgoing messages. User can wire components together to define complex behaviour and workflows. Usually, components call external APIs but they can also do some internal processing, logic or scheduling.

![Flow](https://4112778861-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LATDgYqVMe0hChW7efU%2F-L_wX6vC3ERnOFpc31W4%2F-L_wYg_3yos4MYamt4h9%2FScreenshot%202019-03-14%20at%2015.15.16.png?alt=media\&token=990241f6-5a72-42d8-bf88-ea2a59507266)

Take the example above. There are three components in the flow. The first one (_Timer_) we call a **trigger** because it does not have any input ports and so the component generates outgoing messages based on its internal logic. In our case, the Timer component sends messages to its output port _out_ in regular intervals that the user can specify in the UI. As soon as a message leaves an output port, it travels through all the connected links to input ports of other connected components. In our scenario, when a message leaves the _out_ port of our Timer, it goes to the _location_ input port of the _GetCurrentWeather_ component. As soon as the _GetCurrentWeather_ component receives a message on its input port, it starts processing it. In this case, it requests current weather information from the [https://openweathermap.org](https://openweathermap.org) API. Once a response is received from the API, the component continues to send the result to its output port _weather._ Note that the location for which we're requesting the current weather can be specified by the user in the UI. The process then repeats for all the other connected components until no message is generated on an output port or there is no other component connected.

![Inspector panel](https://4112778861-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LATDgYqVMe0hChW7efU%2F-L_wX6vC3ERnOFpc31W4%2F-L_wYs9HncFTna2H0Lgz%2FScreenshot%202019-03-14%20at%2015.16.01.png?alt=media\&token=db805324-ecef-48cf-b55a-68b3f911e3bc)

To make our example flow complete, it is important to note that any component can be configured using data generated on output ports of any component back in the chain of connected components. In our example, our _SendChannelMessage_ component sends a message on Slack channel #qa-messages with text containing the city, humidity, pressure and temperature as it was received from the weather API. The user configures the flow in the designer UI simply by selecting placeholders (variables in the Appmixer engine jargon) that will eventually be replaced when the flow goes to the running state and the actual data is available.

Components have some important properties that we should mention before diving into the details:

* **Components don't know about each other.** All components are totally independent and loosely coupled. They only react on incoming messages and produce outgoing messages. The linkage between components is not internal to the components themselves but rather a mechanism of the Appmixer engine and its protocol.
* **Components are black-boxes to the Appmixer engine.** The engine does not know and also does not need to know what components internally do and how they are implemented. It only wires them together through ports and makes sure messages are always delivered and in the right order.
