For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom Blocks

Write and run your own logic in a Workflow with custom Python blocks.

When the built-in Blocks do not cover your use case, you can write your own logic in Python and run it as a Block inside a Workflow.

Custom Python blocks let you transform data, call external services, or implement bespoke logic without building and publishing a full plugin. The code lives inside the Workflow Definition itself and is compiled into a real Block at runtime. They run on self-hosted inference servers and on Dedicated Deployments, and on the Roboflow Serverless v2 API where they execute in isolated containers.

Examples

Worked examples of complete custom blocks you can copy into a Workflow and adapt.

Next steps

  • Dynamic Python blocks - the full reference for defining a block inside a Workflow Definition: manifest, dynamic inputs and outputs, the run(...) and init(...) methods, state management, and debugging.

  • Create a Workflow block - write a proper Block class when you need versioning, batch processing, flow control, or custom dimensionality.

  • Bundling blocks into a plugin - package your Blocks into an installable plugin so a whole team or the community can use them.

Last updated

Was this helpful?