Retrieve Your Fluidfit API Key
To retrieve your Fluidfit API key, go to Fluidfit.ai dashboard, click on the user icon on top right and click settings.
Now click on the API menu on the left side bar menu and copy the API key shown on the screen. If you do not have an API yet, click on Generate Key.
Retrieve Your Fluidfit Flow ID
This is the Flow ID of the Fluidfit flow you want to run.
You must have at least one flow configured within the Fluidfit dashboard to run that via API or an external source. Follow these steps to create a flow:
Click on “Add New Flow” on the left side bar
Enter a Flow Name of your choice
Configure the flow you just created, The flow must have one input media node and one output media node. It can have any number of steps, we are showing just one step of “Resize Image” for simplicity.
Once your flow is configured, Go to https://developers.fluidfit.ai/docs/fluidfit/get-flow-list and run this API by clicking “SEND API REQUEST” and adding <your API Key> you just retrieved in the last step to the x-api-key parameter. This will give you the list of all your flows with their IDs. Copy the FlowID from the _id parameter from the response corresponding to the flow name you just created that we want to trigger from n8n.
n8n Configuration
In this example, we are creating a Form to accept an Image and are going to send that image to trigger a Flow within the Fluidfit dashboard and retrieve the resulting processed image within n8n.
Now go over to your n8n dashboard.
Create a new flow on n8n.
Add a new node “On form submission”.
3. On the settings of “On form submission”, Add a Form Title of your choice and a Form Description.
Add a Form element titled “FluidfitImage” and give it a type “File”. See Screenshot below:
Leave everything else as is, and click on “Execute step” to test the form. It should present with the Form we just created and you should test it by uploading any image successfully.
Once the file is uploaded successfully, it should show on the right side as Output.
Now go back to Canvas and add a “Http Request Node” next to the “On Form Submission” node and connect them.
Select the “HTTP Request” node to bring up its settings and configure it as below:
Method : POST
Authentication : None
Send Headers : True
Specify Headers : Using Fields Below
Header Parameters
x-api-key : <YOUR_FLUIDFIT_API_KEY> retrieved in step 1 in this doc.
Send Body : True
Body Content Type : Form-Data
Body Parameters :
Parameter Type : Form Data
Name : flowId
Value : <YOUR_FLOW_ID> The ID of the flow you want to run, It was retrieved from the get Flow List API in Step 2 above.
Parameter Type : n8n Binary File
Name : imageFiles
Value : Fluidfitimage ( The name of the form field you are extracting the image into, from “On Form Submission” step. )
Run Execute Flow and that should trigger a form where you upload the image and it should run the Fluidfit flow and return the processed file in the “result” JSON.