Generating flows
Introduction
Generating a flow is done by posting to the /flow-generations
endpoint.
Creating a flow is a two-step process. First, you create a flow generation that will trigger the generation of the flow. When the flow is generated, you will receive a webhook notification to notify you the flow is ready.
When a flow is successfully generated, you will be billed for the flow generation. The cost of a flow generation is based on the type of flow. The cost of a FlowGeneration will be present on the cost
field
Creating a Vacancy Application Flow
In this guide we will walk you through the steps of generating a vacancy_application_flow
Prerequisites
A vacancy text.
Skills to ask the candidate, read about the VacancyAnalysis endpoint to learn how to generate these.
Webhook subscription (Setting up webhooks) on Flow and/or FlowGeneration for this guide we will assume you have subscribed to FlowGeneration updates.
Communication visualized
Analyzing vacancy
Optionally you can use the VacancyAnalysis endpoint to analyze the vacancy for skills and requirements. You can use the result as input for the FlowGeneration parameters.
Generating the flow
Send a POST
request to the /flow-generations
endpoint.
Include the flow type (see Flow types for available flow types) and parameters in your JSON. In this case our flowType will be vacancy_application_flow
. As context, you will want to give your vacancy text. As we are not passing an existing vacancyId a vacancy will be automatically created and be assigned to the flow
resource.
Example
curl -X POST "https://api.recrubo.app/public/v2/flow-generations" \
-H "Authorization: Bearer xx-xx-xx-xx-xx" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "flowGenerations",
"attributes": {
"flowType": "vacancy_application_flow",
"parameters": {
"knockoutRequirements": [
{
"value": "Has 1 year of javascript experience.",
"sessionField": "java_skill"
},
{
"value": "Fluent in Dutch",
"sessionField": "dutch_fluency"
}
],
"preferredRequirements": [
{
"value": "Lives in amsterdam",
"sessionField": "location"
}
],
"requiredFields": [
{
"value": "name",
"sessionField": "name"
},
{
"value": "email",
"sessionField": "email"
}
],
"optionalFields": [
{
"value": "Link to linkedin page.",
"sessionField": "linkedin"
}
]
},
"context": {
"type":"text",
"value": "Job Title: Java Developer Location: Amsterdam, Netherlands Job Type: Full-time About the Company: At Tech Innovations, we are at the forefront of transforming digital landscapes through our cutting-edge technology solutions. Located in the vibrant city of Amsterdam......."
}
}
}
}'
The Recrubo API will return a response like this: The status
field will be queued
until the flow has been generated. The cost
field will be 0 until the flow has been successfully generated. The created vacancy will be available through the flow (identified by flowId
) in the response.
{
"data": {
"id": "4ef9be44-e1ca-4742-b983-adfce3ac16d0",
"type": "flowGenerations",
"attributes": {
"createdAt": "2024-04-15T14:01:15+00:00",
"updatedAt": "2024-04-15T14:01:15+00:00",
"flowId": "8b139e76-87d5-45ca-a503-a342c714442d",
"flowType": "vacancy_application_flow",
"parameters": {
"knockoutRequirements": [
{
"value": "Has 1 year of javascript experience.",
"sessionField": "java_skill"
},
{
"value": "Fluent in Dutch",
"sessionField": "dutch_fluency"
}
],
"preferredRequirements": [
{
"value": "Lives in amsterdam",
"sessionField": "location"
}
],
"requiredFields": [
{
"value": "name",
"sessionField": "name"
},
{
"value": "email",
"sessionField": "email"
}
],
"optionalFields": [
{
"value": "Link to linkedin page.",
"sessionField": "linkedin"
}
]
},
"context": {
"type": "text",
"value": "Job Title: Java Developer Location: Amsterdam, Netherlands Job Type: Full-time About the Company:At Tech Innovations, we are at the forefront of transforming digital landscapes through our cutting-edge technology solutions. Located in the vibrant city of Amsterdam......."
},
"status": "queued",
"cost": 0
}
}
}
When the flow has been generated a webhook payload will be sent to you looking like this: The status
field will be finished
and the cost
field will be the cost of the flow generation in credits.
{
"data": {
"type": "webhookPayload",
"id": "b1325194-8a33-433e-bad2-89c6463eb720",
"attributes": {
"event": "update",
"resource": {
"id": "0970532b-5231-406a-a4b3-2b977c0bfc18",
"type": "flowGeneration",
"attributes": {
"createdAt": "2024-04-15T14:01:15+00:00",
"updatedAt": "2024-04-15T14:01:15+00:00",
"flowId": "8b149e36-87d5-45ca-a503-a342c714442d",
"flowType": "vacancy_application_flow",
"parameters": {
"knockoutRequirements": [
{
"value": "Has 1 year of javascript experience.",
"sessionField": "java_skill"
},
{
"value": "Fluent in Dutch",
"sessionField": "dutch_fluency"
}
],
"preferredRequirements": [
{
"value": "Lives in amsterdam",
"sessionField": "location"
}
],
"requiredFields": [
{
"value": "name",
"sessionField": "name"
},
{
"value": "email",
"sessionField": "email"
}
],
"optionalFields": [
{
"value": "Link to linkedin page.",
"sessionField": "linkedin"
}
]
},
"context": {
"type": "text",
"value": "Job Title: Java Developer Location: Amsterdam, Netherlands Job Type: Full-time About the Company:At Tech Innovations, we are at the forefront of transforming digital landscapes through our cutting-edge technology solutions. Located in the vibrant city of Amsterdam......."
},
"status": "finished",
"cost": 1
}
}
}
}
Checking your flow
In the BotStudio
You can visually check and tryout your flow in the Recrubo BotStudio, see the BotStudio embeddable. For an example on how to integrate Embeddables into your ATS see the guide Embedding the Inbox.
Otherwise, you can use your developer account to log in to https://recrubo.app and navigating to:
https://recrubo.app/#/bot-studio/<flowId>
Via the API
See Flow to see how you can fetch the flow via the API.
You are now ready to create a FlowRun with the newly generated flow. Please see the next page or click Triggering flows to learn how to do this.
Last updated