More Products

Block reference

Last updated: Apr-08-2024

As explained in Building a Flow, flows are composed of a set of blocks that you connect, creating step-by-step actions to execute. Each block performs a specific function. Blocks are grouped into different categories to make them more accessible.

Triggers

Triggers are special blocks that are used to start the flow execution. For example, use the Catch Webhook block to trigger the flow every time a webhook is sent to a specific URL or use the Scheduler block to trigger the flow on a predefined schedule.

Important
Every flow must start with a trigger block.

Catch Webhook

Webhooks are a simple way for applications to send messages to one another. This is how, for example, your Shopify store can send a message to Slack to notify you of a new order.

Use this block to trigger a flow from any application.

The block is configured with a specific web address (also known as a webhook URL). When the block receives an HTTP request at the webhook URL, it triggers the flow. The triggered flow can then perform a series of actions, such as uploading an image, updating metadata, or calling an API.

To configure any application to trigger the flow:

  1. Click the block to open its configuration sidebar.
  2. Click the copy button to copy the block's webhook URL.
  3. Navigate to the desired application, locate the webhook settings (the steps may vary depending on the application), and paste the block's webhook URL.

Webhook example

You also have the option to add custom parameters that will be available in the following connected blocks. In the block's configuration sidebar, you can add any of the values sent to this flow, that will then also be made available as dynamic values to all blocks connected after this block in the flow.

Dynamic params

Important
The webhook is not automatically verified. Please take all possible precautions to ensure your data remains secure and protected. This includes verifying the source of the webhook whenever possible, testing the flow in a development or staging environment, and monitoring its activity closely.

In the example below, every message received by the flow is automatically sent using SendGrid.

Webhook example

Cloudinary Tags

Use this block to trigger a flow whenever a tag is added to or removed from an asset in Cloudinary.

This block is similar to the Catch Webhook block, but with the Dynamic Parameters of Cloudinary tags webhooks already pre-populated with values such as secure_url, resource_type, public_id, etc.

To configure Cloudinary to trigger the flow when a tag is added/removed:

  1. Click the block to open its configuration sidebar.
  2. Click the copy button to copy the block's webhook URL.
  3. Navigate to Cloudinary's Webhook Notifications page, add a new notification to be sent to the copied webhook URL, and set the notification type to Resource tags changed.

Cloudinary Upload

Use this block to trigger a flow whenever an asset is uploaded to Cloudinary.

This block is similar to the Catch Webhook block, but with the Dynamic Parameters of Cloudinary upload webhooks already pre-populated with values such as secure_url, resource_type, public_id, etc.

To configure Cloudinary to trigger the flow when an upload occurs, click the block to open its configuration sidebar and click the Set Webhook button to automatically add the webhook to your Cloudinary product environment. The notifications are not automatically verified, but MediaFlows can verify them for you if you also add your Cloudinary product environment api_secret, which is needed to compute and verify the notification signature.

If you have not connected your project to Cloudinary yet, you can still manually configure the webhook as follows:

  1. Click the copy button to copy the block's webhook URL.
  2. Navigate to Cloudinary's Webhook Notifications page, add a new notification to be sent to the copied webhook URL, and set the notification type to Upload.

DAM App

Use this block to trigger a flow from your Cloudinary Media Library. This is done using Cloudinary's Apps for DAM. Click the block to configure its appearance and behavior.

To use the MediaFlows DAM App, make sure the app is enabled in your DAM App Marketplace.

DAM App block

To execute the flow, follow the following steps:

  1. Head to Cloudinary's media library.
  2. Select the media on which you want to execute the flow, and select Run MediaFlows from the menu.

    DAM

  3. In the MediaFlows DAM App, click the flow you want to trigger.

DAM flows

Scheduler

Use this block to trigger recurring flows. Trigger an action every day of the month, every day of the week, or every single day. This is similar to a crontab, cronjob, or cron.

Tip
See the Cron expression reference documentation for detailed information on creating a cron schedule expression.

Notes
  • The timezone used is UTC.
  • The minimum scheduling interval is one hour.

Flow Logic

These blocks can be used by any flow to implement logical flow functionality.

Apply On Each

Use this block to run the next connected block on each item in a list. In each of the next connected blocks, you can refer to the relevant item and index using dynamic values.

You also have the option to add custom parameters that will be available in the following connected blocks. In the block's configuration sidebar, you can add any values that will then also be made available as dynamic values to all blocks connected after this block in the flow.

For example, you could split a string and add all items as tags to an asset.

Example of using the apply on each block

Condition

Use this block to determine how to proceed based on a condition.

This is the only block that has two happy paths (two blue dots).

  • The block connected to the upper happy path is executed if the condition is met (returns true).
  • The block connected to the lower happy path is executed if the condition is not met (returns false).

For example, the filter could test if the asset is an image, and if it is, add a text overlay, otherwise send an email:

Example of using the filter block

Note
In the Condition block settings, you must set the Key field to a dynamic value.

Wait For All

Use this block to wait for all other blocks that are connected to this block to complete before continuing the flow.

This block is especially useful after using an Apply On Each block in your flow.

Developer Tools

Add To Logs

Use this block to display a message in the Execution logs. It's good practice to use this block when creating flows for debug purposes, and for displaying messages in MediaFlows logs.

Add to logs

Delay

Use this block to delay the execution of the next block by a set number of seconds.

Delete Media

Use this block to delete an asset. This method calls the destroy method of the upload API.

Join Strings

Use this block to concatenate two strings with an optional separator.

Search and Replace

Use this block to replace all occurrences of a specified string or regular expression with a specified replacement string.

Send HTTP Request

Use this block to communicate with other services and APIs. For example, send the media output to a marketing automation system.

Split String

Use this block to split a string using a predefined separator.

Cloudinary APIs

These blocks interact with Cloudinary APIs.

Account Usage

Use this block to get information about your account usage. This block calls the usage method of the Admin API.

For example, you could schedule a daily email to be sent if a specific quota is exceeded in your usage:

Account Usage example

Apply Actions

Use this block to apply actions on assets in Cloudinary. For example, to convert a video to multiple formats up front, so the different formats of the video will not need to be generated on the fly when first accessed by users. This block calls the explicit method of the Upload API.

Read the documentation on the explicit method to get ideas on what you can achieve with this block. You can include these parameters in the Optional Parameters field.

For example, when media is uploaded to Cloudinary, if the media is a video, apply video optimizations:

Apply Actions example

Create Structured Metadata

Use this block to create new structured metadata on a media asset in Cloudinary. This block calls the metadata_fields method of the Admin API.

Duplicate Media

Use this block to duplicate a media asset in Cloudinary. This enables you to make modifications without affecting the original media file. This block calls the upload method of the Upload API to upload another copy of the asset, with a new public ID.

Get Asset Information

Use this block to get information on a media asset in Cloudinary such as the width, height, version, secure URL, and more. This block calls the explicit method of the Upload API.

For example, when a tag is added to a Cloudinary asset, get the secure URL of the asset and send it to Akeneo.

Get Asset Info example

Get Contextual Metadata

Use this block to get the value of a contextual metadata field of a media asset in Cloudinary. This block calls the resource method of the Admin API.

Get Structured Metadata

Use this block to get the value of a structured metadata field of a media asset in Cloudinary. This block calls the resource method of the Admin API.

Get Tags

Use this block to get the tags of a media asset in Cloudinary. This block calls the resources method of the Admin API.

Manual Moderation

Use this block to send media to a manual moderation process. The assets can then be moderated using the Admin API or the Cloudinary Console. Rejected assets are automatically invalidated on the CDN within approximately ten minutes.

Rename Media

Use this block to rename an asset in Cloudinary or move it to a different folder. This block calls the rename method of the Upload API.

For example, when a media asset is uploaded to Cloudinary, if its size is larger than 3MB, move the asset to the large_files folder:

Rename Media example

Search Media

Use this block to find media assets in Cloudinary that meet a given criteria. This block calls the search method of the Search API. The block returns a maximum of 50 results in each search.

Update Contextual Metadata

Use this block to update contextual metadata on media assets in Cloudinary. This block calls the context method of the Upload API.

Update Structured Metadata

Use this block to update structured metadata on media assets in Cloudinary. This block calls the metadata method of the Upload API.

Update Tags

Use this block to update tags on media assets in Cloudinary. This block calls the tags method of the Upload API.

Upload Media

Use this block to upload content from an FTP, HTTP, or HTTPS URL into your Cloudinary product environment.

You can include optional upload parameters in the Optional Parameters (Advanced) field to fine-tune your upload. For example, when media is uploaded to an S3 bucket, upload it to Cloudinary and add the tag from_s3, so it will be searchable in your Media Library:

Upload media example

Upload Via Request

Use this block to send an HTTP request to a target URL, and then automatically upload the response's media binary to your Cloudinary product environment. You can configure the Request Method, Request Header and Request Body to send in the indicated fields.

Cloudinary add-ons

Note
Before using a block that’s associated with a Cloudinary add-on, make sure you're registered for the add-on.

Amazon Image Moderation

Use this block to automatically and accurately moderate your images.

This block uses the Amazon Rekognition AI Moderation add-on. Make sure you're registered to this add-on in order to use this block.

Cloudinary Background Removal

Use this block to automatically and accurately remove the background of an image.

This block uses the Cloudinary AI Background Removal add-on. Make sure you're registered to this add-on in order to use this block.

Cloudinary Image Captioning

Use this block to automatically generate a descriptive caption for an image file in Cloudinary.

This block uses the Cloudinary AI Content Analysis add-on. Make sure you're registered to this add-on in order to use this block.

Google Image Tagging

Use this block to automatically add tags to an image.

This block uses the Google Auto Tagging add-on. Make sure you're registered to this add-on in order to use this block.

Google Video Tagging

Use this block to automatically add tags to a video.

This block uses the Google Automatic Video Tagging add-on. Make sure you're registered to this add-on in order to use this block.

For example, when the flow is executed using the DAM App, if the selected asset is an image, automatically add tags to the image using the Google Image Tagging block. If the selected asset is a video, automatically add tags to the video using the Google Video Tagging block.

Google Image Tagging example

Integrations

MediaFlows has a number of useful blocks for specific integrations to Cloudinary. If there is an integration that you think should be added then please let us know.

Tip
The Send HTTP Request block can be useful for any other general integrations.

Create An Asset In Akeneo

Use this block to create an asset in Akeneo's Asset Manager.

To allow this block to communicate with Akeneo's API, use the tokens retrieved by the Get Tokens From Akeneo block.

Use Akeneo’s Product Link Rule to automatically link the created Akeneo asset to a product.

This block can be used only with Akeneo versions that support the Akeneo Asset Manager.

Delete An Asset In Akeneo

Use this block to delete an asset from Akeneo's Asset Manager.

To allow this block to communicate with Akeneo's API, use the tokens retrieved by the Get Tokens From Akeneo block.

This block can be used only with Akeneo versions that support the Akeneo Asset Manager.

Dolby io

Use this block to improve the quality of your media with the Dolby.io Media Enhance API.

Fill in the required fields with your API key, API secret (available on the Dolby.io Applications Dashboard), and specify the URL locations of the Input and Output files.

You also have the option to specify a category for the type of Content in the input file, which helps determine the processing settings most suitable for improving the quality.

Note
You need to register to Dolby.io in order to use this block.

Get Tokens From Akeneo

Use this block to retrieve Akeneo tokens. The retrieved tokens can later be used by other Akeneo-related blocks to communicate with Akeneo's API. Make sure you're registered to Akeneo in order to use this block.

The connection information required can be copied from the Akeneo Connections page.

Update Metafield (Shopify)

Use this block to update a metafield value of a product in Shopify.

Fill in the required fields with your Shopify Access Token, Store Name, Product ID, Metafield key, Metafield value, Metafield Namespace, and Metafield Type.

Upload Image (Shopify)

Use this block to add an image to a product in Shopify.

Fill in the required fields with your Shopify Access Token, Store Name, Product ID, and the Image URL.

You also have the options to specify the Image Position (set to 1 for the main image) and Alt text for the image.

Update variant (Shopify)

Use this block to create or update a Shopify product variant. Fill in the required fields with your Shopify Access Token, Store Name, Product ID, Image ID, and Variant ID (leave empty to create a new variant).

Fill in the values for each variant Option (e.g., if the first option of the variant is Size, set this field to Small, Medium, or Large).

Notifications

Send a Message Using Twilio

Use this block to send an SMS or a WhatsApp message using Twilio.

Make sure you're registered to Twilio in order to use this block. The account information required below can be copied from the Twilio console.

Send Email Using SendGrid

Use this block to send an email using SendGrid.

Make sure you're registered to SendGrid and have a Dynamic Template available in order to use this block.

Transformations

Apply Background

Use this block to add a background to transparent regions of a Cloudinary image. This block sets the background to either a specified color or an image using the Transformation API.

Crop Media

Use this block to crop a Cloudinary asset and set the region to focus on (gravity). This block crops using the Transformation API.

Drop Shadow

Use this block to add a shadow to the object(s) in a Cloudinary image. This block applies the dropshadow effect using the Transformation API.

Edit Media

Use this block to apply a custom transformation to a Cloudinary asset using the Transformation API. The transformation parameters can be given as either a comma-separated string or in JSON format.

Enhance Image

Use this block to automatically improve the colors, contrast and brightness of a Cloudinary image. This block applies an improve effect using the Transformation API.

Generative Recolor

Use this block to recolor a specified region of a Cloudinary image while maintaining the relative shading. This block applies a gen_recolor effect using the Transformation API.

Image Overlay

Use this block to add an image overlay to a Cloudinary asset. This block applies an image layer using the Transformation API.

Optimize Media

Use this block to optimize the format and quality of a Cloudinary asset. This block sets the format and quality using the Transformation API.

Resize Media

Use this block to resize a Cloudinary asset. This block resizes using the Transformation API.

Text Overlay

Use this block to add a text overlay to a Cloudinary asset. This block applies adds a text layer using the Transformation API.

✔️ Feedback sent!

Rate this page: