Variables in Bitrix24 workflows are the cells where a process keeps intermediate values: an action result, a computed date, a response from an external system. Together with start parameters and constants they turn a template from a rigid script into a configurable one. In practice, most "the workflow does not work" cases are variable mistakes — wrong type, empty value, broken substitution. This guide covers how the three differ and the standard moves for processing values.

What is the difference between a variable, a parameter and a constant?

Three entities live in the template settings. Parameters are filled at launch by whoever starts the workflow — say, a discount reason — and are read-only inside it. Variables live inside: the process writes and re-reads them as it goes, and action results land here. Constants are set once per template — an amount threshold, a department ID — and can be changed without touching the logic. The practical rule: anything you ask a human for is a parameter; anything computed along the way is a variable; every magic number is a constant, otherwise changing a threshold means hunting it across all conditions.

How do I insert values into actions?

Every action field supports Insert value — a tree picker with document fields (the deal or lead), parameters, variables, constants, results of previous actions and system values. Under the hood these are templates like {=Document:TITLE} or {=Variable:total}. Two traps. Multiple fields are substituted as a comma-separated list: to work with the items one by one, split the list first. And an empty value substitutes as an empty string rather than "nothing" — "equals empty" and "equals an empty string" are not always the same condition in Bitrix24, so verify the behavior on a test record.

How do I process strings and choose values by condition?

The designer ships few string functions, and one-step robots fill the gap. Choosing by condition without a two-branch Condition block: Ternary (if-then-else) compares two values and returns one of two results — "if the discount is empty, use 0" becomes a single action — along with a Y/N flag; operators include eq, neq, gt, lt, contains, is_empty and a regex match. Pulling a fragment out of text — a phone from a comment, an order number from an email subject: Extract by regular expression returns the first match or a chosen capture group, the list of all matches and a found flag. Breaking a list into items — tags separated by commas, a full name into parts: Split string by delimiter returns the parts and their count, and the items become addressable by index.

How do I get a value out of a JSON response?

When a workflow calls external systems over HTTP (the pattern is covered in the workflow guide), the answer arrives as a JSON string — and you need one field from a nested structure. The Extract value from JSON by path robot takes the string and a dot-notation path like data.items.0.price and returns the value into a variable; objects and arrays come back as JSON, and a Y/N found flag lets the workflow branch when the path is missing or the JSON is invalid. "HTTP request → extract from JSON → write to a field" is the standard no-code integration pattern: an exchange rate from an external API, an order status from an ERP, stock levels from a warehouse system.

Why is my variable empty? A checklist

Four frequent causes. The action that should have filled it never ran — check the workflow log; a branch may have bypassed it. The type did not match — a string with a stray space written into a number variable is lost silently. The action result points at the wrong block — after copy-pasting blocks, substitutions keep referencing the original. A multiple value was read as a single one — the whole list landed where one item was expected. The debugging rule: after each important action, temporarily write the variable into a card comment — you will see the real value at every step.

Where to go from here

Variables are the workflow's memory, and discipline pays back: parameters for input, constants for thresholds, variables for results. Value processing — conditional choice, string parsing, JSON extraction — is covered by one-step robots from the robot catalog, so you do not build branching where one action will do. If an operation is missing, describe the task — we build the robot for free and add it to the shared library.