1. Ingestion
Ingestion is the process of sending data to Flowcore, where it is stored in a data core. The data can essentially come from any source, but in this case we will be focusing on data that it is ingested from your local machine.
Before we can start to ingest data into Flowcore, we first need to create a data core.
Likewise, for the purpose of this workshop, we need to output the data to the Flowcathon mini app, using a scenario. That way we can see the ingested data live within the app.
Obtain your tenant name
Go to flowcore.io, and copy your tenant name. You can find your tenant name like this.
Scaffold your data core and scenario
create a
flowcore.yaml
file somewhere on your machine, with the following content:Create a transformer secret
To the keen eye, some of you may have noticed something called
transformer-secret-flowcathon
in theflowcore.yaml
file above. This secret is used to give you permission to output your data to the flowcathon mini app.Currently, the scenario will fail, because it cannot find the secret in your tenant. Therefore, we need to create a secret in your tenant, called
transformer-secret-flowcathon
.The secret value is provided by the instructors.
Run the following command to create the secret:
You can read more about flowcore secrets here.
Please verify that the secret has been created, by navigating to your tenant page on flowcore.io, press the “Settings” button, and scroll down until you see the secret.
Deploy your manifest (resulting in the creation of a data core and scenario on Flowcore.io)
Now that you have scaffolded your entire project, you can deploy your manifest with:
When asked if you want to create your data core, say yes. Afterwards you will be asked if you want to create your scenario, say yes again.
Once the command is finished, your scaffolded project manifest will have been setup in flowcore.io, under your tenant. Verify these resources have been created by:
- viewing your data core under your tenant page,
- and viewing the scenario on the scenario page. (which you can visit by pressing the scenario button on the left hand side)
Ingest your data
Firstly, generate an api key for your tenant, by running the following command:
This key is used to confirm that you are allowed to ingest data into your tenant. Please copy the key, as you will need it in the next step. You can read more about the api keys here.
Next, go to the ingestion page, and generate a webhook ingestion url, as shown in the first section here.
Challenge A
Send some data to your ingestion url, and observe the data showing up on the on the flowcathon mini app. This can be done from your terminal, with something like curl.
For example:
Using curl
in a unix compatible terminal
Using Invoke-WebRequest
in Powershell
You can, for example, use one of the following software options:
Challenge B
Now that you have confirmed that you are able to ingest data, lets try to ingest data into a separate event type.
Try sending some data to your ingestion.challenge-b-ingested.0
event type. To do so, please refer to Challenge A, as well as the prerequisites.
Challenge C
Now that you have figured out how to ingest data into multiple different event types. You now need to process a .csv file into yet another event type, called ingestion.challenge-c-ingested.0
.
So, what you need to do is this:
- Download the csv file from the flowcathon mini app
- Write a script (or use any method you like) to read the csv file
- Send the entries in the csv file to your
ingestion.challenge-c-ingested.0
event type in the format of a json array like this: