Overview
This node generates customizable SVG badges, commonly used to visually represent statuses, metrics, or labels in documentation, repositories, or dashboards. It is useful for creating dynamic badges such as build status, test coverage, version numbers, or any textual indicator that benefits from a visual label.
Practical examples include:
- Displaying the current build status of a project (e.g., "build: passing" with green color).
- Showing code coverage percentage (e.g., "coverage: 85%" with yellow color).
- Indicating deployment environment (e.g., "env: production" with red color).
- Creating custom badges for social media or project metadata.
Properties
| Name | Meaning |
|---|---|
| Text | The main text message displayed on the badge. |
| Output Binary Data | Whether to output the badge as binary data (SVG file) or as raw SVG text. |
| Binary Property | The name of the binary property where the SVG file data will be stored if outputting binary data. |
| File Name | The filename for the generated SVG file when outputting binary data. Automatically appends .svg if missing. |
| Additional Fields | A collection of optional fields to customize the badge appearance: |
| - Color | The color of the badge's message area. Options include Blue, Bright Green, Critical, Gray, Green, Important, Inactive, Informational, Lightgray, Orange, Red, Success, Yellow, Yellow Green. Default is Green. |
| - Label | An optional label text displayed on the left side of the badge. |
| - Label Color | The color of the label area. Same options as Color, default is Lightgray. |
| - Style | The style of the badge. Options are Flat, Flat Square, For The Badge, Plastic, Social. Default is Flat. |
Output
The node outputs either:
- Binary data: An SVG file representing the badge, stored under the specified binary property name. This can be saved or passed to other nodes expecting binary files.
- JSON data: An object containing a
datafield with the raw SVG markup as a string.
Each output item corresponds to an input item, preserving pairing information.
Dependencies
- Uses the external
badge-makerlibrary to generate SVG badges. - No external API keys or services are required.
- Runs fully within n8n without additional configuration.
Troubleshooting
- Common issues:
- If the file name does not end with
.svg, the node automatically appends it; however, providing an invalid file extension may cause confusion downstream. - Providing empty or invalid text may result in badges that do not display meaningful information.
- If the file name does not end with
- Error handling:
- Errors during badge generation throw exceptions with context about the item index.
- Enabling "Continue On Fail" allows processing to continue for other items even if one fails, returning error details in the output JSON.
Links and References
- badge-maker GitHub repository — The underlying library used to create badges.
- Shields.io Styles — Examples of badge styles supported by this node.