ES EN

Introduction to {M}aker

{M}aker is a governance system for M code (Power Query) where Power BI queries do not live inside the .pbix file, but in a centralized database. Power BI executes a "launcher" query that downloads the code from the server and runs it with Expression.Evaluate on every data refresh.

Key concept: Instead of writing and maintaining M code inside each Power BI file, {M}aker centralizes all code on a server. Each Power BI report only needs a launcher function (mmaker()) that downloads and executes the code in real time.

Why {M}aker

In environments with multiple Power BI reports, maintaining M code directly in .pbix files presents several problems:

  • Duplication: the same query is copied across reports and diverges over time.
  • No versioning: there is no native way to see previous versions of M code or rollback.
  • No centralized parameterization: each report has its own hardcoded values.
  • No reuse: sharing a set of queries between reports requires manual copy-paste.

{M}aker solves all this with a central repository of versioned, parameterizable, and reusable queries.

Key concepts

Queries

A query is a Power Query M expression divided into named steps. Each query has a versioning system with drafts: changes accumulate in a draft that is explicitly activated as a new version. Previous versions are immutable and you can rollback to any of them.

Reports

A report groups queries and assigns them a unique access token. From Power BI, the launcher function uses that token to download each query's code. Reports allow configuring different parameter values ({{PARAM}}) for each query, and support multiple tokens (multi-token) for parameter RLS scenarios.

Packs

A pack is a reusable group of queries that can be assigned to multiple reports. Typical use case: a "dimensions" pack (date tables, products, customers) shared across all reports in an organization.

DW (Data Warehouse)

The DW module allows loading data from Excel/CSV files into dynamic MySQL tables. It is organized in three levels:

Pipeline
Reusable process configuration: defines how to parse a file type (columns, globals, fixed values, keys, validations, post-load steps). A pipeline can be shared across multiple bloques.
Bloque
Instance with its own identity: has a unique table name and references a pipeline. Each bloque generates its own dynamic table in the DW database.
App
Grouping of bloques with a fallback pipeline. Organizes related bloques under the same umbrella (e.g., "Sales" with bloques "National Sales", "Export Sales").

BPM / Kanban

Process management system over data loads. Each bloque can have a Kanban board with configurable states, transitions between states (with optional pipelines that execute on transition), and actions that can be invoked on existing loads.

User Portal

Simplified interface for end users (usuario role). Allows uploading files, viewing load status and history without access to technical configuration.

How the system works

The basic flow of {M}aker is:

  1. The configurator creates queries with M code in {M}aker, organized in named steps.
  2. Queries are grouped into reports, where parameter values are configured.
  3. Each report has a unique access token.
  4. In Power BI, a launcher function mmaker() is created with the report's token.
  5. Each query in the report is invoked with mmaker("query_name", true, true).
  6. On every refresh, Power BI calls the server, downloads the updated M code, and executes it.
Advantage: When you change a query in {M}aker, all Power BI reports using it receive the change automatically on the next refresh, without needing to open or modify any .pbix file.

Interface navigation

Topbar

The top bar contains the {M}aker logo and, if you have access to multiple projects, a project selector that filters the entire interface by project. Each project has an assigned color for quick visual identification.

Project selector: When selecting a project, only that project's resources and general resources (from the parent company) are shown. The "All" option shows resources from all accessible projects. General resources appear with a gray "G" badge when filtering by project.

Sidebar

The left sidebar has 5 sections, each collapsible:

SectionContent
DWTree of Apps with their nested Bloques. "+ Bloque" button to create new bloques.
PipelinesList of independent pipelines. "+ Pipeline" button to create new ones.
QueriesFlat list of all queries. Clicking shows M code without applied parameters.
ReportsList of reports with assigned queries as expandable child nodes. "+ Report" button.
PacksList of packs with their queries as expandable child nodes. "+ Pack" button.

The search bar at the top of the sidebar filters by name across all sections simultaneously. Collapsed sections auto-expand if they contain results, and restore when the search is cleared.

Main panel

The central area shows the detail of the element selected in the sidebar, with different tabs depending on the resource type (structure, loads, data, versions, M code, etc.).

User roles

{M}aker implements a hierarchy of 4 roles with incremental permissions:

RoleAccessTypical use
superadmin Entire system: all companies, all users, all configuration. Global platform administrator.
admin Their company and child projects. Can create projects (sub-companies) and manage users. Head of a consulting firm or client company.
desarrollador Full {M}aker interface: queries, reports, packs, DW, pipelines. No admin access. Technical configurator who works with the system day to day.
usuario Portal only: upload files, view status, check history. End user who uploads data but does not configure anything.
Automatic redirect: Users with the usuario role are automatically redirected to the portal on login. They do not have access to the {M}aker configuration interface.

Consulting firm model

Companies can have a parent-child relationship (consulting firm-project). A company with parent_id is a project under a parent company. Admins see their company and all its projects; superadmins see everything.

Company "Consulting Firm" (parent)
  +-- Admin: ana@consultingfirm.com
  +-- Project "Client Acme" (child)
  |     +-- Developer: dev@consultingfirm.com
  |     +-- User: contact@acme.com (portal only)
  +-- Project "Client Beta" (child)

Next steps

Check the following sections of this wiki to dive deeper into each area:

  • Queries: creation, versioning, placeholders and references between queries.
  • Reports: query grouping, access tokens, launchers, and multi-token.
  • Packs: reusable query groups shared across reports.
  • DW - Pipelines: data load process configuration.
  • DW - Bloques: data instances with their own table.
  • DW - Apps: bloque grouping.
  • BPM / Kanban: process and state management over loads.

Queries

A query in {M}aker is a Power Query M expression with a unique name, divided into ordered steps. Queries are the fundamental resource of the system: everything else (reports, packs, launchers) is built on top of them.

Query types

Each query has a type that determines how it's used from Power BI. The type shows in the sidebar as a letter (T/S/C) next to the name:

  • T (transform): pure query, only M transformations (Table.*, List.*, Text.*, Date.*...). Invoked via mmaker() and refreshes in PBI Service. Default type.
  • S (staging): query with connectors (Excel.Workbook, SharePoint.Files, Sql.Database, Web.Contents...). Pasted literal in the .pbix as a separate query, its output feeds a transform. See Power BI integration guide for details.
  • C (completa): full query with connectors in "quick & dirty" mode. Requires the Desktop variant of mmaker pasted in the .pbix (same name, body uses #shared). Does NOT refresh in PBI Service.
Automatic division: when you paste M code with connectors, {M}aker detects the query is not PBI Service compatible and offers to split it into staging + transform. The staging becomes a separate query (to paste in the .pbix) and the transform stays in {M}aker with the pure transformation steps.

Creating a query

To create a query, click "+ Query" in the Queries section of the sidebar, or use the creation button inside a report.

Name
Unique identifier for the query. Cannot be repeated within the same company. Descriptive names without spaces are recommended (e.g., Monthly_Sales, Dim_Product).
Description
Optional text describing the query's purpose. Visible in the detail panel.
Steps
Optionally, you can create the query with initial steps. If not, it's created empty and steps are added later.

Steps

Each query is composed of one or more ordered steps. Each step is an independent M expression that can reference previous steps.

Step fields

nombre_paso (step name)

Name of the step. If it contains spaces, hyphens, accents, or starts with a number, Power Query requires quoting with #"Step Name".

Valid examples: Source, FilterRows, #"Filter Rows", #"Step-2"

codigo_paso (step code)

M expression for the step. Never starts with StepName = — the system adds that automatically when generating the let/in block.

Correct example: Table.SelectRows(Source, each [Sales] > 0)

Incorrect example: FilterRows = Table.SelectRows(Source, each [Sales] > 0)

es_output (is output)
Marks the step as the query's final output. Exactly one step must have es_output = 1 per version. This step is used in the in clause of the generated let/in block.
notas (notes)
Free text to document the step's purpose. Does not affect generated code.
Critical rule: There must be exactly 1 step marked as output per version. If there are none or more than one, the generated M code will be invalid.

Adding, modifying, and deleting steps

Steps are managed from the "Steps" tab in the query detail panel. The "+ Add step" button offers four options:

  • Manual step: specify name, M code, position (order), and whether it's the output.
  • DW step: create a SQL query on DW tables and auto-generate M connection steps.
  • Paste M code: paste a complete let ... in block and replace all query steps.
  • Create with AI assistant: open the AI chat to generate steps using natural language.
  • Modify step: when editing a step, changes go to the draft (created automatically if it doesn't exist).
  • Delete step: removes the step from the current draft.
Step renaming: When renaming a step, the system automatically updates #"OldName" references in other steps of the same draft.

Paste complete M code

This option is useful when you've been working on M code directly in Power Query (where you can see live results) and want to sync it back to {M}aker.

  1. Copy the complete let ... in block from Power Query's Advanced Editor.
  2. In {M}aker, select the target query and click "+ Add step" → "Paste M code".
  3. Paste the code in the textarea and click "Parse".
  4. The system shows a preview with detected steps, which one is the output, and warnings for external references.
  5. Click "Replace steps" to confirm.
Replaces all steps: This operation substitutes all existing query steps with those from the pasted code. In DEV mode it activates directly; in normal mode it creates a draft you can review before activating.
External references: If the pasted code contains #"Name" references that are not steps within the query itself, the system detects them and shows a warning. These references may be to other queries in the same report (which work inside Expression.Evaluate) or queries that should be rewritten as mmaker("name", true, true).

Versioning system

{M}aker implements an immutable versioning system with drafts:

version_activa (active version)
The official version in use. This is what Power BI downloads on data refresh. Previous versions are immutable: once activated, their steps cannot be modified.
version_borrador (draft version)
Working version where changes accumulate. Can be NULL if there is no active draft. When any step is modified, a draft is automatically created if one doesn't exist.

Typical workflow

  1. You start from the active version (e.g., version 3).
  2. When editing a step, a draft is automatically created (version 4).
  3. More changes are made: all go to the draft (version 4).
  4. When everything is ready, you activate the draft → version 4 becomes the active version.
  5. Power BI will download version 4 on the next refresh.

Activate draft

Converts the draft into the new active version. You can optionally add a change description. Once activated, that version's steps become immutable.

Discard draft

Deletes the draft and all its changes. The active version is not modified.

Rollback

Changes version_activa to any previous version. Does not delete versions — it simply points to a different one. Useful for quickly reverting problematic changes.

Draft debugging: From Power BI, you can invoke mmaker("query_name", false, true) (second parameter false) to load the draft instead of the active version. This lets you test changes before activating them.

Placeholders (parameters)

Steps can use placeholders with the syntax {{PARAM_NAME}} in M code. These placeholders are substituted with concrete values when the query is served in the context of a report.

Format rules

  • Double braces: {{ and }}
  • Only uppercase letters, numbers, and underscores
  • Valid examples: {{COMPANY_ID}}, {{FISCAL_YEAR}}, {{SERVER_2}}
  • Invalid examples: {{company_id}}, {{year}}, {{my param}}

How they resolve

Each query assigned to a report can have configured values for its placeholders. When serving M code via the codigo_m_report endpoint, the system substitutes each {{PARAM}} with the value configured in that report (or token).

Important: If a query has placeholders without a configured value in a report, the endpoint returns HTTP 422 indicating missing parameters. Power BI will show an error on refresh.

Placeholder change detection

When activating a new version, if placeholders have changed compared to the previous version (added or removed), the system notifies and allows resolving the changes for each affected report.

References between queries

Inside Expression.Evaluate, normal Power Query references (#"Other Query") resolve as null. For a query to reference another {M}aker query, use the launcher function:

mmaker("other_query_name", true, true)

This downloads and executes the other query in the same refresh. The result can be used like any M table or value.

Usage example

// Step "Source" of query "Sales_With_Products"
let
    Sales = mmaker("Sales_Raw", true, true),
    Products = mmaker("Dim_Product", true, true),
    Result = Table.NestedJoin(Sales, "ProductID", Products, "ID", "Product", JoinKind.LeftOuter)
in
    Result
Nested let/in blocks: When a step contains its own let/in block, it must be wrapped in parentheses: (let ... in result). This is an M syntax rule when a let/in is inside another block.

Quick invocation

In each query's detail panel, next to the title, there's a button to copy the invocation to the clipboard:

let Source = mmaker("query_name", true, true) in Source

Critical M code rules

When writing steps in {M}aker, keep these mandatory rules in mind:

RuleCorrectIncorrect
Code never starts with StepName = Table.FromRows(...) Source = Table.FromRows(...)
Nested let/in in parentheses (let x = 1 in x) let x = 1 in x (inside another step)
Quoting with #"Name" for special characters #"Filter Rows" Filter Rows (without quoting)
Exactly 1 output step per version One step with es_output = 1 Zero or multiple outputs
No wrapping single quotes Table.FromRows(...) 'Table.FromRows(...)'
Windows paths with double backslash "C:\\Data\\file.xlsx" "C:\Data\file.xlsx"
Real characters, not Unicode escapes "Information" "Informaci\u00f3n"

Broken references

When a query references another via mmaker("query_name") and that query doesn't exist, it's considered a broken reference.

  • In the sidebar, queries with broken references show a warning badge ⚠.
  • In the detail panel, a banner appears with the list of broken references.
  • Broken references don't prevent operation, but will cause errors in Power BI when trying to resolve the referenced query.

Renaming queries

When renaming a query, the system automatically detects if other queries reference it with mmaker("old_name"). If there are dependencies, it offers two options:

  1. Auto-update references: the system corrects mmaker("old_name") to mmaker("new_name") in all referencing queries.
  2. Manual correction: the query is renamed and the list of affected queries is shown for manual correction.
Recommendation: Use automatic reference updating whenever possible. Manual correction is error-prone and can leave broken references.

M Code tab

The "Codigo M" (M Code) tab in the detail panel shows the let/in block generated from the active version's steps. This is the exact code that Power BI will download when invoking the query.

If the query is viewed from a report context (clicking it from a report's child node), the code shows placeholders substituted with the values configured in that report. If viewed directly from the Queries section in the sidebar, placeholders appear unsubstituted.

Reports tab

The "Reports" tab shows the list of reports containing this query, whether assigned directly or through a pack. This lets you quickly see where each query is used.

Step emulator

The emulator lets you see how each step transforms data, without needing Power BI open. It's integrated into the Steps view:

  1. In the top bar of the Steps view, upload a file with "Upload Excel/CSV" or paste JSON with "Paste JSON".
  2. Select the start step (the step whose output the uploaded data represents).
  3. Each step the emulator can process shows a badge with the resulting row count.
  4. Click a step to see its result table below the step list.
Paste JSON from Power BI: Use mmaker("query_name", true, true, "StepName") in Power BI to get a table with the first 50 rows of an intermediate step. Copy the resulting JSON and paste it with "Paste JSON". This is useful for queries connected to databases, APIs, or SharePoint that the emulator cannot simulate directly.
Emulator limitations: The emulator supports the most common M functions (Table.AddColumn, SelectRows, RemoveColumns, RenameColumns, Sort, ReplaceValue, etc.) and basic Text/Number/Date functions. Steps with unsupported functions (like Table.NestedJoin or Web.Contents) show a warning without breaking the chain.

Reports

A report in {M}aker is a grouping of queries with an access token that allows Power BI to download and execute M code. Each report represents a Power BI report (or group of reports) that share the same set of queries and parameters.

Creating a report

Click "+ Report" in the Reports section of the sidebar.

Name
Unique identifier for the report. Serves as a visual reference — it's not used in M code.
Description
Optional text describing the report's purpose or which Power BI file it's associated with.
Token
Auto-generated when creating the report (format mk_xxx...). This token is used in the Power BI launcher function to authenticate requests. It can be regenerated at any time from the interface.

Importing queries when creating the report (optional)

The "New report" modal includes a selector in the import section with two ways to populate the report with existing queries:

Paste M code
Paste a let ... in block (or several, prefixed with // QueryName). The system detects steps, assigns names and rewrites cross-references #"Other Query" to mmaker("other_query", true, true).
Load dataflow JSON
Upload the file exported from Power BI Service (Dataflow → Export) or paste its content. See the Import Power BI dataflow section below.

If the import fails after creating the report, the system automatically deletes the created report (rollback) to avoid inconsistent state.

Import Power BI dataflow

Allows bulk transfer of a Power BI Service dataflow into {M}aker queries in a single operation. Available in two places:

  • When creating a report, choosing "Load dataflow JSON" in the new report modal (creates the report and assigns queries in one step).
  • In an existing report, from the dropdown "+ Add query" → "Import dataflow (JSON)".

A standalone third option exists (without a report), but converting parameters to {{placeholders}} requires a target report.

What the importer does

  1. Reads the dataflow JSON and extracts all queries (section Section1; shared X = let ... in X;), groups (folders) and metadata.
  2. Classifies each query as table, parameter (has meta [IsParameterQuery = true]) or function ((args) as type => ...).
  3. Rewrites cross-references (#"Other Query" or bare names like StartDate) to mmaker("other_query", true, true) so they work inside the launcher's Expression.Evaluate.
  4. Detects conflicts with existing queries in the company and duplicates within the batch itself (e.g. when two different names like aux FestivosMadrid and aux_FestivosMadrid collide after sanitizing).
  5. Shows an editable preview with checkbox per row, renamable final name and warnings.

Preview and options

Conflict policy
Rename (default): applies automatic suffix _2, _3... to colliding queries while keeping refs consistent.
Skip: does not import queries that already exist in DB.
Overwrite: creates a new active version for queries that already exist.
Final name (editable per row)
You can manually change the proposed name before importing. References mmaker("original_name", ...) in other queries of the batch are automatically rewritten to the name you pick.
Create pack per group
If the dataflow has groups (folders like PARAMETERS, FUNCTIONS, DIMENSIONS), creates one pack per group with the corresponding queries and assigns it to the report.
Assign to active report
Only visible in the dropdown flow (in the new report modal this is implicit).
Convert PQ parameters to {{placeholders}}
Active by default when there's a target report. See the next section.

Converting parameters to mmaker placeholders

Power Query parameters (queries with meta [IsParameterQuery = true] like SV = "52.236.82.20" or StartDate = #date(2000, 1, 1)) are constant values, not processes. Creating them as {M}aker queries would add an unnecessary HTTP round-trip and break the multi-token/RLS model where each token can have its own value.

When the option is active, the importer:

  • Does not create a query for the selected parameters.
  • Rewrites refs in the other batch steps: mmaker("SV", true, true) → {{SV}}.
  • Adds entries to report_params with nombre_placeholder=SV and valor="52.236.82.20" (the literal value with quotes / M functions intact, for direct textual substitution in the generated M code).

The visual indicator on parameter rows shows → {{NAME}} so you see before confirming what will happen to each one.

Placeholder name: the sanitized name of the original parameter is used. You can edit it in the row input; refs in the other batch queries will adjust to the final name.
Refs in pre-existing queries: if there was already a query assigned to the report invoking mmaker("SV", true, true), the importer does not modify it. The user's previous decision is preserved.

Assigning queries

A report can contain queries in two ways:

Direct assignment

From the report's "Estructura" (Structure) tab, use the "Add query" button to select existing queries. Each directly assigned query can have an optional alias — an alternative name shown in the interface without affecting the code.

Via packs

From the same tab, you can assign packs to the report. The report automatically inherits all queries from the pack. See the Packs section for more details.

Ownership verification: When Power BI requests a query, the server verifies that the query belongs to the report (either directly or through a pack). If it doesn't, it returns HTTP 403.

Parameters (placeholders)

If queries assigned to the report contain placeholders ({{PARAM}}), they must be configured with concrete values.

Parameter configuration

From the "Estructura" (Structure) tab, each query shows its pending placeholders. Clicking a query opens the parameter editor where values are entered.

ConceptDescription
Placeholder Variable in M code with format {{NAME}}. Automatically detected.
Value Text that replaces the placeholder when serving code. Can be a number, text, path, etc.
Status Visually indicates whether a placeholder has a configured value or is pending.
Unconfigured placeholders: If any placeholder remains unconfigured, the codigo_m_report endpoint returns HTTP 422 and Power BI will show an error on refresh. Make sure to configure all parameters before using the report in production.

Multi-token system (parameter RLS)

In addition to the report's main token (legacy token), {M}aker supports creating multiple access tokens per report, each with its own parameter values.

Use case

Imagine a report with a query that filters data by company using {{COMPANY_ID}}. With multi-token you can:

  • Create a token "Company A" with COMPANY_ID = 1
  • Create a token "Company B" with COMPANY_ID = 2
  • Create a token "All" with COMPANY_ID = 0

Each Power BI user uses a different token and gets different data, all with the same queries.

Token management

Tokens are managed from the report's "Accesos" (Access) tab:

Create token
Specify a descriptive name and optionally a description. The token string is auto-generated.
Configure parameters
Each token has its own set of values for the query placeholders. Values are configured independently per token.
Duplicate token
Creates a copy of an existing token with all its parameters. Useful for creating variants with small differences.
Regenerate token
Generates a new token string (invalidates the previous one). Useful if a token has been compromised.
Toggle active/inactive
Temporarily deactivates a token without deleting it. An inactive token does not serve M code — Power BI will receive an error.
Delete token
Permanently deletes the token and all its configured parameters.
Parameter model: Parameters are at report level (report_params): one value per placeholder, shared by all queries of the report. Access tokens can have their own overrides in report_token_params. If two concepts need different values, use different names (e.g. CURRENT_YEAR vs PREVIOUS_YEAR), not the same name with two values.

Substitution in Power Query M vs DW SQL

The same {{PARAM}} substitutes in two different contexts with different rules:

Power Query MDW SQL (dw_consultas)
Substitution typeTextual (no quotes)Auto-quoted (PDO::quote)
String"{{REGION}}" — manual quotes{{REGION}} — no quotes
Number{{N}}{{N}} — MySQL coerces
LIMIT / OFFSET—Not supported (requires int literal, rejected by PDO::quote)
SecurityDesigner's responsibilitySQL injection prevented via quote
Quick rule:
  • M (.pbix): you control the quotes based on the type
  • SQL (dw_consultas): never put quotes around {{PARAM}}

Example: same REGION parameter in both contexts

// Power Query M (filter step)
= Table.SelectRows(Data, each [region] = "{{REGION}}")

-- DW SQL (named query)
SELECT * FROM dw_1_sales WHERE region = {{REGION}}

Special case: dynamic LIMIT

Auto-quoting prevents using LIMIT {{N}} because MySQL requires an integer literal. Alternative: hardcode in the query (LIMIT 1000) or use per_page in the HTTP call.

Placeholder detection in the report panel

The Launcher tab's parameter panel automatically detects all placeholders used by the report's queries. Two key behaviors:

  • Placeholders in DW consultas: if a Power Query step invokes a DW query (dw_sql), the system also scans that query's SQL and adds its {{PARAM}} to the panel. Configure the value once and it applies in both places (M + SQL).
  • Draft vs active: if a query has a draft, placeholders from the draft are used. This lets you configure and test new parameters while developing, without having to activate the version first.
Validation when saving DW queries with placeholders: syntax validation temporarily substitutes each {{PARAM}} with a dummy value before LIMIT 0. You can save queries with parameters without needing configured values.

Launcher tab

The "PQ Queries" (or "Launcher") tab shows the M code for the launcher function that must be created in Power BI to connect with this report.

The mmaker() function

The launcher is a Power Query function with three parameters:

NombreQuery (text)
Name of the query to download from {M}aker. Must exactly match the registered name.
Version (logical)
true = active version (published), false = draft (in development). Appears as a dropdown in Power BI thanks to Documentation.AllowedValues.
Evaluar (logical)
true = executes the downloaded M code, false = shows the code as text without executing (debug mode). Also appears as a dropdown in Power BI.

Launcher structure

let
    FnType = type function (
        NombreQuery as (type text meta [
            Documentation.Description = "Query name in {M}aker"
        ]),
        Version as (type logical meta [
            Documentation.Description   = "true = active; false = draft",
            Documentation.AllowedValues = {true, false},
            Documentation.DefaultValue  = true
        ]),
        Evaluar as (type logical meta [
            Documentation.Description   = "true = execute; false = show code",
            Documentation.AllowedValues = {true, false},
            Documentation.DefaultValue  = true
        ])
    ) as any meta [
        Documentation.Name = "mmaker"
    ],

    Fn = (NombreQuery as text, Version as logical, Evaluar as logical) =>
    let
        Token     = "mk_your_token_here",
        BaseUrl   = "https://your-server/mmaker/api.php",
        Response  = Text.FromBinary(
                        Web.Contents(BaseUrl, [
                            Query = [
                                action = "codigo_m_report",
                                token  = Token,
                                query  = NombreQuery,
                                v      = if Version then "activa" else "borrador"
                            ]
                        ])
                    ),
        Result    = if Evaluar then
                        Expression.Evaluate(Response, #shared)
                    else
                        Response
    in
        Result
in
    Value.ReplaceType(Fn, FnType)
Tip: When creating the launcher in Power BI, paste the code from the "Launcher" tab directly into a new blank query (Advanced Editor). The token and URL are pre-filled with the report's values.

Usage from Power BI

Once the mmaker function is created, each query in the report is invoked like this:

// In a new blank query:
mmaker("Monthly_Sales", true, true)

Or in full step format:

let
    Source = mmaker("Monthly_Sales", true, true)
in
    Source

Parameters as dropdowns in Power BI

Thanks to Documentation.AllowedValues = {true, false}, Power BI shows the Version and Evaluar parameters as dropdowns in the invocation interface. Documentation.DefaultValue pre-fills the default values.

DW tables in the launcher

If the company has tables in the DW (Data Warehouse) module, the launcher tab also shows a "DW Tables (API)" section with copyable M code for each table.

These tables are accessed via Web.Contents to the dw_data endpoint, using the same report token. The generated M code includes:

  • Automatic pagination with List.Generate for large tables.
  • Automatic type conversion (Table.TransformColumnTypes) based on column types.
  • Exclusion of internal columns (_dw_*) by default.

For each table, there's a "Copy M" button that copies the code ready to paste in Power BI as a blank query.

Advantage over ODBC: Access via Web.Contents does not require installing a MySQL driver, configuring a gateway, or exposing the database. It only needs HTTP connectivity to the {M}aker server.

Status tab

The "Estado" (Status) tab shows a report status summary:

  • Number of assigned queries (direct and via packs).
  • Parameters pending configuration.
  • Active and inactive tokens.

Deleting and renaming reports

Delete: Deletes the report, all its tokens, and parameter configurations. Queries are not deleted — they continue to exist as independent resources.

Rename: Changes the report name. Does not affect tokens or Power BI operation (the token is the real identifier, not the name).

Packs

A pack in {M}aker is a reusable group of queries that can be assigned to multiple reports. Packs allow sharing a common set of queries across several Power BI reports without assigning them one by one.

Typical use case

In most Power BI projects, there are queries that repeat across many reports:

  • Dimension tables: dates, products, customers, regions.
  • Helper functions: common transformations, data cleaning.
  • Base connections: queries that establish connection to a shared data source.

Instead of assigning these queries individually to each report, they are grouped in a pack (e.g., "Common Dimensions") and the pack is assigned to each report that needs it.

Advantage: If a new query is added to the pack (e.g., a new dimension), all reports using that pack inherit it automatically. No need to touch each report individually.

Creating a pack

Click "+ Pack" in the Packs section of the sidebar.

Name
Unique identifier for the pack. A descriptive name of the query group it contains is recommended (e.g., "Common Dimensions", "SAP Connections", "ETL Utilities").
Description
Optional text explaining the pack's purpose and what type of queries it groups.

Managing pack queries

Adding queries

From the "Queries" tab in the pack's detail panel, use the "Add query" button to select existing queries. A list of available queries (those not already in the pack) is shown.

Query order

Queries within a pack have a defined order. The order determines the position in which they appear in the interface. You can reorganize queries by dragging or changing their position.

Note: The order of queries in a pack does not affect execution in Power BI. Each query is invoked independently with mmaker("name", true, true). The order is purely organizational within the {M}aker interface.

Removing queries from the pack

To remove a query from a pack, use the unassign button next to each query in the list. This does not delete the query — it only unlinks it from the pack. The query continues to exist as an independent resource.

Warning: If you remove a query from a pack, all reports using that pack will lose access to that query through the pack. If any Power BI report invokes that query with mmaker("name"), it will receive a 403 error on the next refresh (unless the query is assigned directly to the report).

Assigning packs to reports

Packs are assigned to reports from the report's "Estructura" (Structure) tab (see the Reports section). When assigning a pack, the report inherits all the pack's queries.

Dynamic inheritance

The relationship is dynamic: if queries are added to or removed from the pack after assignment, the report reflects the changes automatically. No need to reassign the pack.

Duplicate queries

If a query is assigned both directly to the report and through a pack, there is no conflict. The server serves it regardless. Parameters are resolved the same way.

Parameters in pack queries

Parameter values ({{PARAM}}) for pack queries are configured at the report level, not at the pack level.

Important: A pack does not store parameter values. Each report using the pack configures its own values for the inherited queries' placeholders. This allows the same pack to be used in reports with different parameters.

Example

Suppose a "Dimensions" pack with the query "Dim_Company" that uses {{DB_SERVER}}:

ReportAssigned packValue of {{DB_SERVER}}
Production Report Dimensions srv-prod.company.com
Development Report Dimensions srv-dev.company.com
UAT Report Dimensions srv-uat.company.com

All three reports share the same query from the pack, but each substitutes the placeholder with its own server.

Usage tab

The "Uso" (Usage) tab in the pack's detail panel shows the list of reports that have this pack assigned. It lets you see at a glance where the pack is used and evaluate the impact of any change.

Deleting a pack

When deleting a pack:

  • It is unlinked from all reports that used it.
  • The pack's queries are not deleted — they continue to exist as independent resources.
  • Reports that used the pack lose access to those queries (through the pack). If they still need them, they must be assigned directly.
Before deleting: Review the "Usage" tab to see which reports use the pack. Make sure those reports don't need the queries or have them assigned through another route (directly or through another pack).

Renaming a pack

You can rename a pack using the edit button next to the title. Renaming does not affect assignments or functionality — it is purely a visual name change.

Best practices

Group by functional domain
Create packs that represent a logical domain: "Dimensions", "ERP Connections", "Utilities". Avoid generic packs like "Common queries" that grow without control.
One pack, one purpose
It's better to have several small, specific packs than one large one with everything. This makes selective assignment to reports easier.
Document with the description
Use the pack's description to explain what it contains and when it should be used. This helps other configurators decide whether to assign the pack to their reports.
Review the impact
Before modifying a pack's queries, review the "Usage" tab to know how many reports will be affected.

Pipelines

A pipeline in {M}aker is a reusable process configuration that defines how to parse a file type, which columns to extract, what validations to apply, and what actions to execute after loading. It is the "blueprint" of the process: it defines the how, but not the where.

Pipeline vs Bloque: A pipeline defines the process configuration (columns, globals, fixed values, keys, upload fields, steps). A bloque is an instance with its own identity: it owns the destination table (dw_{empresa_id}_{nombre_tabla}) and executes its assigned pipeline. Multiple bloques can share the same pipeline.

Creating a pipeline

Click "+ Pipeline" in the Pipelines section of the sidebar. A 3-step wizard opens.

Step 1 — Basic data and sample file

Name
Unique identifier for the pipeline within the company. Should be descriptive of the file type or process it manages (e.g., "Monthly Sales", "CSV Stock Load").
Description
Optional free text documenting the purpose of the pipeline.
Sample file
An Excel (.xlsx, .xls) or CSV file used as a template for column detection and structure. The system reads the headers and offers type autodetection.
"No file" toggle
Enable this toggle to create a pipeline that does not process files. Used for action pipelines (BPM): they only execute pipeline steps without inserting data into a table. When enabled, the file selector disappears and step 3 auto-generates fixed columns from the upload fields.
Pipeline without file: When "No file" is enabled, each upload field (except type file) automatically generates a fixed column with campo_carga_ref linked. The table is built entirely from fixed values. The load process is equivalent to "adding a row" by filling out the upload fields, without uploading any file.

Step 2 — Upload fields

Upload fields are forms that the user fills in when uploading a file (or when executing a no-file pipeline). See the Upload fields section for full details on types, SQL options, groups and conditions.

Step 3 — Structure

Defines the destination table structure and how to map file data to database columns.

Destination table

Table name
Internal name of the dynamic table to be created in mmaker_dw. The final name will be dw_{empresa_id}_{table_name}. Only letters, numbers and underscores allowed. Cannot be changed after creation.
Header row
Row number in the Excel file containing column names. Defaults to 1.
Data row
Row number where data begins. Defaults to 2. If the file has metadata rows between the header and data, adjust this value.
Nullable table name: If the pipeline is "no file" and will only execute steps (mailing, triggers, BPM states), the nombre_tabla field can be left empty. In that case no dynamic table is created and the pipeline only executes its post-load steps.

Data columns

Each column defines a mapping between a source file column and a destination table field.

Field Description
nombre_origen Column name as it appears in the source file header. Must match exactly (case-sensitive).
nombre_campo Column name in the destination MySQL table. Only letters, numbers and underscores.
tipo_dato MySQL data type: varchar, int, decimal, date, datetime, text.
longitud Maximum field length. Defaults to 255 for varchar. For decimal, this is the total precision (e.g., 10 in DECIMAL(10,2)).
decimales Only for decimal type. Number of decimal places (e.g., 2 in DECIMAL(10,2)).
formato_fecha Dual use depending on data type:
  • For int and decimal: number format. Value eu = European format (dot as thousands separator, comma as decimal: 1.234,56). Empty = US format (comma as thousands, dot as decimal: 1,234.56).
  • For date and datetime: PHP date format (e.g., d/m/Y, Y-m-d, d-m-Y H:i:s). If empty, the system attempts to autodetect the format.
orden Relative position of the column in the table. Determines column order in the UI and during table creation.
European number format: If your files use the format 1.234,56 (dot for thousands, comma for decimals), set eu in the formato_fecha field of int or decimal columns. The parser will automatically convert to standard MySQL format.

Globals (fixed cells from file)

Globals extract values from fixed cells in the Excel file (not from the tabular data zone). They are useful for metadata that appears at a fixed position in the file (e.g., reporting month in cell B1, year in cell C1).

Field Description
nombre_campo Column name in the destination table where the value will be stored.
fila Row number of the cell (1-based).
columna Column number of the cell (1-based, where A=1, B=2, etc.).
tipo_dato varchar, int, decimal or date.

The value extracted from the global cell is repeated in every row inserted from that load. It acts as a constant that comes from the file itself.

Fixed values (Fijas)

Fixed values assign a constant value to a column for all rows in each load. Unlike globals, the value does not come from the file but from the configuration.

Field Description
nombre_campo Column name in the destination table.
valor Literal value, SQL expression (e.g., NOW(), CURDATE()) or pipeline variable (e.g., {{_DW_CARGA_ID}}). Evaluated at insertion time.
campo_carga_ref If enabled, the fixed value is taken from the indicated upload field instead of the literal value. The UI provides a toggle to switch between literal value and upload field reference.
tipo_dato varchar, int, decimal or date.
Upload fields as columns: Upload fields do NOT automatically create columns in the table. For a value entered by the user during upload to appear as a column, you must create a fixed column with campo_carga_ref pointing to the upload field name.

Singularity (Keys)

The singularity (keys) system controls data deduplication. Before inserting new rows, the system deletes existing rows that match on all configured key fields. If no keys are configured, data simply accumulates (append only).

Key type Value source Examples
columna Data from the file (mapped column) producto, fecha, codigo
global Fixed cell from the file (globals) ANIO, MES
interno Internal DW table field _dw_bloque_id, _dw_fichero, _dw_hoja_idx, _dw_hoja_nombre
campo_carga Field filled by the user during upload Resolved via the fixed column that has campo_carga_ref pointing to the field
"Bloque singularity" switch: The configuration UI includes a switch that controls only _dw_bloque_id as an internal key. When enabled, loads from one bloque only affect (delete/replace) data from that same bloque, never from other bloques sharing the same table.
No keys = no deletion: If you do not configure any keys, each load adds new rows without deleting anything. Data accumulates indefinitely. This may be intentional (event history) or a configuration error.

Required (mandatory fields)

Marks columns that must have a value in each row. Rows where a required field is empty are rejected as errors and recorded in dw_carga_errores. Valid rows are inserted normally.

Pipeline without table

Since migration 037, the nombre_tabla field in dw_pipelines is nullable. A pipeline without a table:

  • Does not create a dynamic table in mmaker_dw.
  • Does not execute data INSERT.
  • Only executes post-load steps (validations, SQL, variables, mailing, triggers, BPM states).

Typical use cases:

  • BPM actions: Change the state of a load in the Kanban board.
  • Automated mailing: Send emails as an action on an existing load.
  • Chained triggers: Execute other pipelines in response to an action.
  • Standalone validations: Check data without modifying the table.
UI recognition: Pipelines without a table are created by enabling the "No file" toggle in step 1 of the wizard. When confirmed, the dw_guardar_pipeline_config endpoint skips CREATE/ALTER table operations on the dynamic table.

Multi-sheet (config_hojas)

For Excel files with multiple sheets, the pipeline can configure which sheets to process and whether they share the same structure.

"nombres" mode
Identifies sheets by their exact name. Useful when the file always has a sheet called "Datos" among other variable sheets.
"indices" mode
Identifies sheets by their position (0-based). Useful when the sheet name changes (e.g., the month name) but it is always at the same position.
misma_estructura
If true, all selected sheets share the same column configuration. If false, each sheet can have its own independent column mapping.

The internal columns _dw_hoja_idx and _dw_hoja_nombre are automatically populated with the sheet index and name for each row. They can be used as singularity keys (type interno).

Editing an existing pipeline

From the pipeline detail panel (Structure tab), click "Edit configuration". This opens the DW wizard in edit mode:

  • The wizard jumps directly to step 2 (upload fields), pre-populated with the current configuration.
  • The "Destination table" field is read-only — the dynamic table cannot be renamed once created.
  • When saved, dw_actualizar_pipeline + dw_guardar_pipeline_config are called, applying changes and executing ALTER TABLE if needed (adding new columns, modifying types).
Column type changes: Modifying the data type of an existing column executes an ALTER TABLE. If the table already has data, MySQL may reject the change if existing data is not compatible with the new type (e.g., text in a column changed to int).

Sharing a pipeline across bloques

A pipeline can be assigned to multiple bloques. Each bloque using the same pipeline:

  • Shares the same column configuration, globals, fixed values, keys and upload fields.
  • Has its own destination table (unique name per bloque).
  • Executes the same post-load steps.

To assign a pipeline to a bloque, use the "Change" button in the bloque panel header, or the dw_asignar_pipeline_bloque endpoint.

Effective pipeline: The pipeline a bloque uses is resolved with the formula: bloque.pipeline_id ?? app.pipeline_id ?? null. If the bloque has its own pipeline, that one is used. Otherwise, it inherits the pipeline from the containing app. If neither is defined, the bloque uses its legacy configuration (dw_bloque_* tables).

Deleting a pipeline

A pipeline can only be deleted if it has no assigned bloques. If there are bloques referencing the pipeline, the system prevents deletion and shows an error. You must reassign or delete the linked bloques before you can delete the pipeline.

Post-load steps

Pipelines can include steps that execute automatically after data insertion. Available step types are documented in detail in the Pipeline steps section. Types include: validations (stop/alarm), SQL, variables, mailing, triggers, loops, result tables, flyouts and BPM states.

Pipeline structure summary

Component Table Function
Columns dw_pipeline_columnas File-to-table mapping (nombre_origen to nombre_campo + type)
Globals dw_pipeline_globals Fixed cells from the file (row + column to field)
Fixed values dw_pipeline_fijas Constant values or upload field references
Keys dw_pipeline_keys Singularity fields (deduplication)
Required dw_pipeline_required Mandatory fields per row
Upload fields dw_pipeline_campos_carga Form filled by the user during upload
Steps dw_pipeline_pasos Post-load actions (validation, SQL, mailing, etc.)

Blocks

A block is an instance with its own identity within the DW module. Each block represents a concrete data destination: it has a company, a name, and a unique dynamic table in the mmaker_dw database. The combination empresa_id + nombre_tabla generates the table dw_{empresa_id}_{nombre_tabla}.

While a pipeline defines how a file is processed (columns, validations, steps), the block defines where the data lands. Multiple blocks can share the same pipeline, but each block has its own table and its own upload history.

Creating a block

To create a block, click "+ Bloque" in the DW section of the sidebar. This opens the DW wizard in block mode with 3 steps:

Step 1 — Basic data

Block name (unique per company), optional description, and a sample file to detect structure. Optionally, you can check "Sin fichero" (No file) if the block will only receive data via upload fields.

Step 2 — Upload fields

Form that the user will fill in when uploading data. Fields of type input, number, select, date, or file are defined. See Upload fields section for more detail.

Step 3 — Structure

Target table (nombre_tabla), header row, data row, globals, fixed values, and data columns. This configuration defines the structure of the dynamic table that will be created in mmaker_dw.

Table name: The nombre_tabla is defined during creation and cannot be changed afterwards. Choose a descriptive lowercase name without spaces (e.g., sales, monthly_stock).

Block fields

FieldTypeDescription
nombre VARCHAR(100) Visible block name (unique per company)
nombre_tabla VARCHAR(100) Dynamic table name (immutable after creation)
descripcion TEXT Optional description
pipeline_id INT FK Assigned pipeline that defines the process configuration
app_id INT FK Container app (Phase 2). Can be NULL for standalone blocks
fila_cabecera INT File row containing headers (default: 1)
fila_datos INT First data row (default: 2)
config_hojas JSON Multi-sheet configuration (name/index mode, selected sheets)
fichero_master VARCHAR(255) Internal name of the reference master file
expectativa_carga JSON Expected upload frequency/calendar

Pipeline assignment

A block obtains its process configuration (columns, globals, fixed values, keys, required, upload fields, steps) from a pipeline. Resolution follows this hierarchy:

effective pipeline = block.pipeline_id ?? app.pipeline_id ?? null
block.pipeline_id
If the block has a directly assigned pipeline, that one is used (override).
app.pipeline_id
If the block has no own pipeline but belongs to an app with a pipeline, it inherits the app's pipeline (fallback).
null (no pipeline)
If there is no pipeline at either level, the block uses its own configuration (legacy mode). See next section.

In the block detail panel, the header shows the assigned pipeline with a link to the pipeline and a "Cambiar" (Change) button that opens a modal with a selector of available pipelines.

Sharing pipelines: If several blocks need the same structure and process (e.g., same Excel template from different branches), assign them the same pipeline. Changes to the pipeline are reflected in all blocks that use it.

Legacy mode (no pipeline)

If a block has no assigned pipeline (neither direct nor via app), it uses its own configuration stored in the dw_bloque_* tables:

  • dw_bloque_columnas — data columns
  • dw_bloque_globals — fixed file cells
  • dw_bloque_fijas — constant values
  • dw_bloque_keys — singularity keys
  • dw_bloque_required — required fields
  • dw_bloque_campos_carga — upload form fields

In this mode, the Estructura (Structure) tab shows the full configuration and allows editing it via the "Edit configuration" button.

Legacy mode: Migrating legacy blocks to pipelines is recommended. Legacy mode is maintained for backward compatibility, but new features (advanced steps, triggers, etc.) are optimized for the pipeline model.

Dynamic table

When creating or saving a block's configuration, the system generates (or alters) a table in the mmaker_dw database named dw_{empresa_id}_{nombre_tabla}.

Automatic internal columns

Every dynamic table includes these internal columns, managed automatically by the system:

ColumnTypeDescription
_dw_id INT AUTO_INCREMENT PK Unique row identifier
_dw_carga_id INT ID of the upload that inserted this row
_dw_bloque_id INT Source block ID
_dw_linea INT Line number in the original file
_dw_fichero VARCHAR(255) Name of the uploaded file
_dw_hoja_idx INT Sheet index (NULL for CSV)
_dw_hoja_nombre VARCHAR(255) Excel sheet name
_dw_timestamp DATETIME Insertion timestamp

After the internal columns, user-defined columns are added: first globals, then fixed values, and finally data columns from the file.

Internal columns in singularity: The columns _dw_bloque_id, _dw_fichero, _dw_hoja_idx, and _dw_hoja_nombre can be used as singularity keys of type interno. This is useful for controlling deduplication granularity.

Block panel tabs

The block detail panel has 5 main tabs:

Structure tab

Shows the block's full configuration: target table, globals, fixed values, columns, keys, and required fields. Allows editing the configuration via the wizard.

Hidden with pipeline: If the block has an assigned pipeline, this tab shows a notice "Configuration managed by pipeline X" with a link to the pipeline. Configuration is edited from the pipeline, not from the block.

Uploads tab (Cargas)

Upload history (last 100 uploads) with the following information per upload:

DataDescription
File nameOriginal name of the uploaded file
Statusok, error, procesando (processing), or cancelado (cancelled)
BPM StatusCurrent Kanban state (if applicable)
Rows OK / ErrorCount of inserted vs rejected rows
DateUpload start and end time
UserWho performed the upload

Expanding an upload's detail shows:

  • Available actions: BPM action buttons filtered by the upload's current estado_bpm.
  • Upload field values: the values the user filled in when uploading.
  • Result tables: tables generated by tabla type pipeline steps.
  • Flyouts: files generated by flyout type pipeline steps, with download button.
  • Errors: rejected rows with line number, reason, and JSON data.
  • Execution log: detailed step-by-step pipeline log.
  • Child uploads: uploads generated by BPM actions on this upload.

Data tab (Datos)

Paginated table with the contents of the dynamic table dw_{empresa_id}_{nombre_tabla}. Shows all columns (internal and user-defined) with server-side pagination.

View tab (Vista)

Contains two sub-tabs:

Kanban
Drag & drop board where columns are the configured states and cards are uploads with the corresponding estado_bpm. Requires the block to have Kanban states configured. See Kanban / BPM section.
Public form
Public upload form configuration for external users. See Public forms section.

Actions tab (Acciones)

CRUD for BPM actions available on the block's uploads. Each action links a pipeline that runs on an existing upload. See Kanban / BPM section for full detail.

FieldDescription
nombreVisible action name (e.g., "Approve", "Reject")
pipeline_idPipeline to execute on the upload
iconoOptional icon (emoji)
estado_origenOnly visible when the upload is in this state (NULL = always visible)

Upload flow

The data upload process to a block follows 4 steps:

Step 1 — Upload fields

A modal opens with the upload fields defined in the pipeline/block. If field groups are configured, the modal works as a multi-step wizard:

  1. The first visible group is shown (based on conditions).
  2. The user fills in the fields and clicks Continue.
  3. The next group's condition is evaluated (siempre, valor_igual, valor_diferente, sql).
  4. If the group is visible, it's shown; otherwise, it's skipped to the next one.
  5. After all groups, a summary of filled values is shown.

If no groups are configured (legacy mode), all fields are shown together in a single step.

Step 2 — File selector

The user selects the Excel (.xlsx, .xls) or CSV file to upload. The file is uploaded to the server and stored in uploads/tmp/.

Step 3 — Preview

The system parses the file according to the configuration (header row, data row, sheets) and shows the first 20 rows in a preview table. The user can verify that column mapping is correct before confirming.

Step 4 — Confirmation

Upon confirmation, the system executes the following sequence:

  1. Singularity delete: if singularity keys are configured, existing rows matching all key fields are deleted.
  2. Insert: valid rows are inserted into the dynamic table, applying type conversions and verifying required fields.
  3. Pipeline: the post-upload pipeline runs (validations, SQL, variables, mailing, etc.).
  4. Log: errors (rejected rows) and pipeline results are recorded.
  5. Initial BPM state: if the block has Kanban with es_inicial=1 state, it's assigned automatically.

The file is moved from uploads/tmp/ to uploads/procesados/.

Rollback on validacion_stop: If a validacion_stop step finds rows violating the condition, a full rollback is performed: inserted data is deleted and pipeline SQL operations are undone. The upload is marked with error status.

Execution without file

A block can execute its pipeline without uploading a file, using the "Ejecutar pipeline" (Execute pipeline) button in the Uploads tab. This is useful for pipelines that only need upload fields (no file data).

The flow:

  1. A modal with upload fields is shown (if any).
  2. On confirmation, an upload is created with nombre_fichero = '[sin fichero]'.
  3. A single row is inserted into the dynamic table with fixed values (including fixed values with campo_carga_ref).
  4. The pipeline runs normally.
Pipelines without table: If the assigned pipeline has no nombre_tabla (tableless pipeline), no row is inserted — only the pipeline steps are executed. This is typical for BPM action pipelines.

Master file

Each block can have a master file for reference. This file is stored in uploads/masters/ and serves as a template or reference for uploads.

Upload master
save_master action in dw_upload.php. Uploaded via FormData and stored associated with the block.
Download master
get_master action in dw_upload.php. Serves the file as a binary download with ownership verification.
Usage in wizard
When editing the block/pipeline configuration, the master file can be re-parsed to update column detection.

Singularity (keys)

Singularity keys control data deduplication. Before inserting new rows, existing rows matching all defined key fields are deleted.

Key typeValue sourceExample
columna File data (mapped column) product, date
global Fixed file cell (globals) YEAR, MONTH
interno DW table internal field _dw_bloque_id, _dw_fichero
campo_carga Field filled by user on upload Resolved via campo_carga_ref in the fixed value
No keys: If no singularity keys are configured, uploads only accumulate data without deleting anything. Each upload adds new rows.
Block singularity: The UI has a "Block singularity" switch that controls only the internal key _dw_bloque_id. When activated, each upload replaces all previous data for that block (full replacement behavior).

Deleting a block

When deleting a block:

  • The block record is deleted from dw_bloques.
  • DROP TABLE is executed on the dynamic table dw_{empresa_id}_{nombre_tabla} in mmaker_dw.
  • Cascading deletes remove: uploads, errors, logs, upload fields, actions, Kanban states, transitions, and bricks.
Irreversible operation: Deleting a block permanently destroys the dynamic table and all its data. There is no way to recover them. Exporting data before deletion is recommended.

Related endpoints

GET

EndpointParamsDescription
dw_bloques—List blocks with num_columnas, num_cargas
dw_bloque_detallebloque_idFull config: columns, globals, fixed, keys, required
dw_cargasbloque_idUpload history (last 100)
dw_carga_logcarga_idPipeline execution log
dw_carga_errorescarga_idRejected rows with reason
dw_datosbloque_id, page?, per_page?Paginated dynamic table data

POST

ActionKey fieldsDescription
dw_crear_bloquenombre, nombre_tabla?, descripcion?Create DW block
dw_actualizar_bloquebloque_id, nombre?, descripcion?Update name/description
dw_eliminar_bloquebloque_idDelete block + DROP table
dw_guardar_configbloque_id, columnas[], etc.Save full config + CREATE/ALTER table
dw_asignar_pipeline_bloquebloque_id, pipeline_idAssign pipeline to block
dw_mover_bloque_appbloque_id, app_idMove block to another app

dw_upload.php

ActionTypeDescription
previewFormDataUpload file to tmp, parse, return preview (20 rows)
confirmJSONSingularity delete + insert + pipeline + log
delete_cargaJSONDelete upload and its data from the table
execute_pipelineJSONExecute pipeline without file
save_masterFormDataSave reference master file
get_masterGETDownload master file
get_flyoutGETDownload generated flyout file

Apps

An App is a logical grouping of bloques within the DW module. Its main purpose is to organize related bloques under a single umbrella and, optionally, provide a fallback pipeline that is inherited by all its bloques that do not have their own pipeline assigned.

Key concept: The DW structure follows the hierarchy App → Bloque → Pipeline. The app groups bloques; the pipeline defines how data is processed. A bloque always belongs to an app (even "standalone" bloques have an implicit container app).

Effective pipeline (fallback)

The system resolves the pipeline that applies to each bloque using the following cascade logic:

effective pipeline = bloque.pipeline_id ?? app.pipeline_id ?? null
bloque.pipeline_id
If the bloque has a pipeline assigned directly, that one is used. It has the highest priority.
app.pipeline_id
If the bloque does NOT have its own pipeline, it inherits the pipeline configured on its container app. This is the fallback pipeline.
null
If neither the bloque nor the app have a pipeline, the bloque has no process configuration and will not be able to process file uploads automatically.
Fallback advantage: If you have 10 bloques with the same file structure (same columns, same validations, same steps), you can assign the pipeline once at the app level instead of configuring it on each bloque individually. If a specific bloque needs a different process, simply assign its own pipeline to override the fallback.

Creating an app

To create a new app:

  1. In the DW section of the sidebar, click the "+ App" button (or use the context menu).
  2. A modal opens with the following fields:
FieldRequiredDescription
Name Yes Unique name for the app within the company. Identifies the app in the sidebar and panels.
Description No Optional descriptive text about the app's purpose.
Pipeline No Fallback pipeline. Selected from the list of available pipelines in the company. Can be left empty and assigned later.
  1. Click Create. The app will appear in the sidebar under the DW section and its detail panel will open.
Unique name: The app name must be unique within the same company. The system validates this and will return an error if you try to create an app with an already existing name.

App panel

When selecting an app in the sidebar, its detail panel is displayed with two main areas:

Header

The header shows:

  • The app name (with a rename button on hover).
  • Description (if any).
  • Pipeline badge: if the app has a fallback pipeline assigned, a badge with the pipeline name appears. Otherwise, it indicates no pipeline is configured.
  • Edit (name, description, pipeline) and Delete buttons.

Bloque list

Below the header, all bloques belonging to the app are listed. Each bloque appears as a card with:

  • Bloque name.
  • Associated dynamic table name.
  • Effective pipeline indicator (own or inherited from app).
  • "Upload" button that directly opens the file upload modal for that bloque (selectBloqueDWAndUpload(id)).
Quick access: The "Upload" button on each bloque in the app panel allows you to start a load without having to navigate to the bloque first. This is especially useful when you have an app with many bloques and want to quickly load data into one of them.

Sidebar: Apps → Bloques tree

The DW section of the sidebar shows a hierarchical tree:

DW
  +-- App "Sales"            [click to view app panel]
  |     +-- Invoices         [click to view bloque panel]
  |     +-- Returns          [click to view bloque panel]
  |     +-- Credits          [click to view bloque panel]
  +-- App "HR"
        +-- Payroll
        +-- Attendance
  • Clicking the app name opens its detail panel.
  • Clicking the triangle/arrow expands or collapses child bloques without changing the active selection.
  • Clicking a bloque opens the bloque detail panel (with its tabs: Structure, Loads, Data, Kanban, etc.).
  • The sidebar search bar filters both apps and bloques by name. If a bloque matches the search, its parent app is automatically expanded.
Expansion state: The system remembers which apps are expanded/collapsed during the session. When clearing a search, the original expansion state is restored.

Moving bloques between apps

A bloque can be moved from one app to another using the dw_mover_bloque_app endpoint:

ParameterDescription
bloque_id ID of the bloque to move.
app_id ID of the destination app.
Impact on effective pipeline: When moving a bloque to another app, if the bloque does not have its own pipeline (pipeline_id = NULL), its effective pipeline will change to the fallback of the new app. This can alter how loads are processed in that bloque. Verify that the new app has a compatible pipeline or assign a direct pipeline to the bloque before moving it.

Deleting an app

To delete an app, use the Delete button in the app panel.

Safety guard: It is not possible to delete an app that still has bloques assigned. You must first move all bloques to another app or delete them individually. The system will return an error if you attempt to delete an app with bloques.

Steps to delete an app that has bloques:

  1. Move each bloque to another app using dw_mover_bloque_app.
  2. Alternatively, delete the bloques (this also drops their dynamic tables and all load history).
  3. Once the app is empty, use dw_eliminar_app.

Access permissions

The permission system allows granular access control to apps and bloques with two axes:

App axis (app-level access)
When granting dw_app permission to a user, they inherit access to all bloques in that app. This is the simplest way to grant access when the user needs to see/use the entire app.
Bloque axis (bloque-level access)
When granting dw_bloque permission to a user, they access only that specific bloque, regardless of the app. Useful when a user only needs access to a subset of bloques.
Permission typeScopeUse case
dw_app All bloques in the app User who manages the entire area (e.g., all of "Sales")
dw_bloque Only the specific bloque User who only uploads invoices but not returns
Permission inheritance: App-level permissions are additive. If a user has permission on the "Sales" app, they can automatically access all present and future bloques in that app. If a new bloque is added to the app, the user will already have access without any additional configuration.

Permission management is done from the Administration panel (Users section), where you can assign and revoke permissions per user. You can also see which users have access to a specific resource from the Permissions tab in the DW table manager.

Use case examples

Example 1: "Sales" app with shared pipeline

A company receives three types of commercial files with the same structure (columns: product, date, amount, customer):

App "Sales"
  pipeline_id = 5 (Pipeline "Standard Sales")
  +-- Bloque "Invoices"     (pipeline_id = NULL -> inherits Pipeline 5)
  +-- Bloque "Returns"      (pipeline_id = NULL -> inherits Pipeline 5)
  +-- Bloque "Credits"      (pipeline_id = NULL -> inherits Pipeline 5)

All three bloques share the same process pipeline. Each one has its own dynamic table (dw_1_invoices, dw_1_returns, dw_1_credits), but the columns, validations, and post-load steps are identical. If you need to change a validation, you change it once in Pipeline 5 and it applies to all three bloques.

Example 2: App with fallback pipeline and override

An app where most bloques use the same process, but one needs a different one:

App "HR Reports"
  pipeline_id = 8 (Pipeline "Standard HR")
  +-- Bloque "Payroll"       (pipeline_id = NULL  -> inherits Pipeline 8)
  +-- Bloque "Attendance"    (pipeline_id = NULL  -> inherits Pipeline 8)
  +-- Bloque "Evaluations"   (pipeline_id = 12    -> uses Pipeline 12, ignores fallback)

Payroll and Attendance inherit the standard pipeline from the app. Evaluations has its own pipeline because the file structure is different (different columns, different validations). There is no need to move Evaluations to another app: simply assign its own pipeline to override the fallback.

Example 3: App as organizational grouping

If you do not need a fallback pipeline, the app functions simply as a visual/organizational grouping:

App "Master Data"
  pipeline_id = NULL (no fallback)
  +-- Bloque "Products"     (pipeline_id = 3)
  +-- Bloque "Customers"    (pipeline_id = 4)
  +-- Bloque "Suppliers"    (pipeline_id = 5)

Each bloque has its own pipeline because each master has a different structure. The app only serves to logically group them in the sidebar and simplify permission management (a single dw_app permission grants access to all three bloques).

API endpoints

GET

EndpointParametersDescription
dw_apps — Lists all accessible apps with num_bloques and pipeline_nombre.
dw_app_detalle app_id App detail with its list of bloques.

POST

ActionFieldsDescription
dw_crear_app nombre, descripcion?, pipeline_id? Creates a new app.
dw_actualizar_app app_id, nombre?, descripcion?, pipeline_id? Updates name, description, or pipeline of the app.
dw_eliminar_app app_id Deletes the app (only if it has no bloques).
dw_mover_bloque_app bloque_id, app_id Moves a bloque to another app.

Summary

AspectDetail
Main functionGroup related bloques and share a pipeline
Pipeline fallbackbloque.pipeline_id ?? app.pipeline_id
DeletionOnly if the app has no bloques
PermissionsApp axis (all bloques) or bloque axis (individual)
SidebarDW tree with expandable/collapsible nodes
Unique namePer company (UNIQUE KEY (empresa_id, nombre))

Upload Fields

Upload fields (campos de carga) are form fields that users fill out before or during a file upload to a bloque. They capture contextual information not contained in the file itself: period, client, responsible person, cutoff date, attachments, etc.

They are configured in the pipeline assigned to the bloque (or directly in the bloque in legacy mode). When a user starts an upload, the system presents these fields before showing the file preview.

Key concept: Upload fields do NOT automatically create columns in the bloque's dynamic table. If you need a field's value to appear as a column in the table, you must create a fixed column (fija) with campo_carga_ref pointing to the field. This is explained in detail below.

Field properties

Each upload field has the following properties:

nombre_campo
Internal field name. Used as identifier throughout the system: in {{nombre_campo}} references within pipeline SQLs, in fixed columns with campo_carga_ref, and in group conditions. Must be unique within the pipeline. Use short names without spaces or special characters (e.g., period, client_id, cutoff_date).
etiqueta
Label visible to the user in the upload form. Can be long and descriptive (e.g., "Select the reporting period", "Report cutoff date").
tipo
Determines the type of control presented to the user. Available types are: input, number, select, date, file. Each is described in detail below.
opciones
Only applies to the select type. Defines the dropdown options, either as a CSV list or a SQL query. Detailed in the select type section.
obligatorio
If enabled, the user cannot proceed with the upload without filling this field. Required fields are shown with a visual indicator (asterisk) in the form.
orden
Field position within its group (or within the general list if no groups). Fields are presented to the user in ascending order.

Field types

input — Free text

Single-line text field. The user can type any value. Useful for names, codes, references, short comments.

PropertyValue
HTML control<input type="text">
ValidationRequired only (if marked)
OptionsN/A (ignored)
Stored valueExact text entered by the user

number — Numeric

Numeric field. Accepts integers and decimals. The browser displays increment/decrement controls and validates that the content is a number.

PropertyValue
HTML control<input type="number" step="any">
ValidationRequired + numeric format
OptionsN/A
Stored valueNumber as text (e.g., 1234.56)
Tip: The step="any" attribute allows decimals with any precision. If the user types "3.14159", that exact value is stored.

select — Dropdown

Selection field with predefined options. Options are defined in the opciones property in two ways:

Static options (CSV list)

A comma-separated list of values. Each value is used as both the visible label and the stored value.

Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec

This generates a dropdown with 12 options. If the user selects "Mar", the stored value will be Mar.

Sales,Purchasing,HR,Finance

Dynamic options (SQL query)

If the options field starts with SQL:, the system executes the query against the mmaker_dw database to obtain options in real time.

SQL:SELECT elemento, valor, seleccionado FROM my_options_table WHERE active = 1 ORDER BY elemento

The query must return columns with these exact names:

ColumnRequiredDescription
elementoYesText displayed in the dropdown (what the user sees)
valorYesInternal value stored when the user selects this option
seleccionadoNoIf 1, this option is pre-selected when the form opens. Only one option should have this value.
Practical example: A "Client" field whose options come from a DW clients table:
SQL:SELECT name AS elemento, id AS valor, 0 AS seleccionado FROM `mmaker_dw`.`dw_1_clients` WHERE active = 1 ORDER BY name
This generates a dropdown with client names but stores the numeric ID.

Dependent selects ({{field}} variables)

SQL queries in a select can reference the value of other upload fields using the {{field_name}} syntax. This enables cascading selects where one field's options depend on what the user selected in a previous field.

SQL:SELECT name AS elemento, id AS valor, 0 AS seleccionado FROM `mmaker_dw`.`dw_1_cities` WHERE country_id = '{{country}}' ORDER BY name

In this example, {{country}} is replaced by the value the user selected in the country field. The select options are reloaded each time the user navigates between wizard groups.

Important: SQL selects with {{field}} are re-evaluated each time the user navigates between wizard groups. If the user changes the value of "country" and returns to the group containing "city", the city options are reloaded with the new country value.

date — Date picker

Date field. The browser displays a native calendar control for date selection.

PropertyValue
HTML control<input type="date">
ValidationRequired + valid date format
OptionsN/A
Stored valueISO date format: YYYY-MM-DD (e.g., 2026-04-07)

file — Attachment

Field for uploading an attachment file. Unlike the main upload file (which is parsed and loaded into the table), file type attachments are supplementary files stored as-is, without parsing.

PropertyValue
HTML control<input type="file">
Storageuploads/adjuntos/ with unique internal name
RecordTable dw_carga_adjuntos (original name, internal name, size)
OptionsN/A
Security: Attachment files are saved with a system-generated name (uniqid()), not the user's original filename. The uploads/adjuntos/ directory has an .htaccess that denies direct access. Files can only be downloaded through PHP endpoints with permission verification.
Note: Fields of type file cannot be used as a fixed column value (campo_carga_ref). They are also excluded from default values in schedules (scheduled executions) and radars, since these processes run without user intervention.

Value storage

The values users enter in upload fields are saved in the dw_carga_campos_valores table, linked to the upload (carga_id). Each row has:

ColumnDescription
carga_idID of the upload the values belong to
nombre_campoInternal field name (matches the configuration)
valorValue entered by the user (always stored as text)

This means that for each upload, a record of what values the user entered is kept. This can be reviewed later in the upload history.

Linking fields to table columns (campo_carga_ref)

By default, upload fields are only stored as upload metadata (in dw_carga_campos_valores). They do not appear as columns in the bloque's dynamic table.

To make a field's value appear in every row of the dynamic table, you must create a fixed column (fija) with the campo_carga_ref property pointing to the field.

How to do it

  1. Go to the pipeline (or legacy bloque) structure configuration.
  2. In the Fixed columns section, add a new fija.
  3. Give it a nombre_campo (this will be the column name in the table).
  4. Instead of typing a literal value, activate the toggle to switch to upload field reference mode.
  5. Select the upload field from the dropdown.

Now, every time an upload is performed, the value the user entered in that field will be inserted into every row of the table as the value for that fixed column.

Example: If you have an upload field period (type select with options Jan, Feb, Mar...) and create a fija period with campo_carga_ref = period, every row in the uploaded file will have a column period with the value selected by the user (e.g., "Mar").

Uniqueness by upload field

Fixed columns linked to upload fields can also participate in uniqueness (keys). If you need the key combination to include the upload field, add a key of type campo_carga with the field name. The system will resolve the value by finding the fija that has campo_carga_ref pointing to that field.

Usage in the pipeline (variables)

Upload field values are available as variables in all pipeline steps. They are referenced with the {{field_name}} syntax inside any pipeline SQL.

SELECT * FROM {{_DW_TABLA}}
WHERE _dw_carga_id = {{_DW_CARGA_ID}}
  AND period = '{{period}}'

In this example, {{period}} is replaced by the value the user selected in the period field.

Field groups (multi-step wizard)

When a pipeline has many upload fields, or when some fields only apply in certain cases, they can be organized into groups. Groups turn the upload form into a multi-step wizard.

Without groups (legacy mode)

If no groups are defined, all fields are shown at once in a single form step, followed by the file selector. This is the classic behavior.

With groups

If one or more groups are defined, the upload form becomes a wizard:

  1. The first visible group is shown with its fields.
  2. The user fills in the fields and clicks Continue.
  3. The next group's condition is evaluated. If visible, its fields are shown.
  4. If not visible, it skips to the next group whose condition is met.
  5. When all groups have been processed, a summary is shown with all entered values plus the file selector.
  6. The user confirms and proceeds to the preview.

Continue and Back buttons allow navigation between groups.

Group properties

nombre
Visible title of the group in the wizard. Displayed as the heading for the current step.
orden
Group position in the wizard sequence. Groups are presented in ascending order.
condicion_tipo
Determines when the group is shown. Options are:
  • siempre — Group is always shown, no condition.
  • valor_igual — Group only shown when another field's value equals a specific value.
  • valor_diferente — Group only shown when another field's value differs from a specific value.
  • sql — Group shown if a SQL query returns at least one row (server-side evaluation).
condicion_campo
Only applies to valor_igual and valor_diferente. Name of the upload field whose value is evaluated. Must be a field from a previous group (already filled by the user).
condicion_valor
Only applies to valor_igual and valor_diferente. Value to compare against. For sql, contains the SQL query to execute.

Conditional groups example

Suppose a process where the user first selects the operation type, then different fields are shown depending on the selection:

GroupOrderConditionFields
General data 1 siempre operation_type (select: Sale, Purchase, Return), date
Sale data 2 valor_igual, field: operation_type, value: Sale client, salesperson, discount
Purchase data 3 valor_igual, field: operation_type, value: Purchase supplier, purchase_order
Return data 4 valor_igual, field: operation_type, value: Return reason, original_reference

If the user selects "Sale", they will see: General data → Sale data → Summary. The purchase and return groups are automatically skipped.

Fields without a group

Fields that do not belong to any group are shown in an implicit initial step, before any defined groups. If all fields have a group assigned, there is no implicit step.

SQL condition in groups

The sql condition allows more complex logic. The query is executed on the server (mmaker_dw) and can reference already-filled fields with {{field_name}}:

SELECT 1 FROM `mmaker_dw`.`dw_1_configuration` WHERE type = '{{operation_type}}' AND requires_approval = 1

If the query returns at least one row, the group is shown. If it returns no rows, the group is skipped.

Pipeline without file

When a pipeline is configured without a file ("No file" toggle in the wizard), upload fields become the only data source. In this mode:

  • No Excel/CSV file is uploaded.
  • Each upload inserts a single row into the dynamic table.
  • The row values come from fixed columns linked to upload fields (campo_carga_ref).
  • The wizard auto-generates a fija for each upload field (except type file).

This mode is useful for manual entry processes: creating a new record, logging an incident, capturing an event, etc.

Use case: A "New Client" pipeline with fields for name, tax ID, address, phone. Each time someone fills the form, a row is added to the clients table. No file needed.

UI configuration

Where to configure

Upload fields are configured in step 2 of the wizard when creating/editing a pipeline (or legacy bloque). Step 2 is dedicated exclusively to upload fields.

Available actions

  • Add field: Button to create a new field with the properties described above.
  • Reorder: Drag fields to change their presentation order.
  • Edit: Modify any property of an existing field.
  • Delete: Remove a field from the pipeline. Values already saved in previous uploads are preserved in dw_carga_campos_valores.
  • Create group: Organize fields into groups for the multi-step wizard.

Fields in scheduled executions and radars

Schedules and radars can preconfigure default values for upload fields. These values are used automatically when the execution triggers without user intervention. Fields of type file are excluded from default values, as attachment files cannot be preconfigured.

Pipeline Steps (Post-load)

Pipeline steps are actions executed automatically after data is inserted into a bloque's dynamic table. They form a decision tree that can validate data, execute SQL, capture variables, send emails, generate files, change states, and more.

Steps are configured in the pipeline assigned to the bloque. They execute in order (by their orden field), unless transitions redirect the flow to a different step.

Execution context: Steps execute within a transaction. If a validacion_stop step detects a problem, everything is rolled back: the inserted data and any SQL changes from the pipeline are undone.

General concepts

Execution order

By default, steps execute sequentially according to their orden field. However, if a step has transitions defined, the flow jumps to the step indicated by the first matching transition. If no transition matches and a resto (fallback) transition exists, that one is used.

If no transitions are defined for a step, execution simply continues to the next step by order.

Anti-loop protection

A step never executes twice in the same pipeline run. If a transition points to an already-executed step, it is skipped and execution continues to the next step.

Execution condition (sql_condicion)

Any step can have an sql_condicion field. If defined, the system executes that SQL query before the step:

  • If the query returns at least one row → the step executes.
  • If the query returns no rows → the step is skipped (moves to the next one).

This allows conditional step execution without needing transitions. The sql_condicion can use the same {{...}} variables as the rest of the step.

SELECT 1 FROM {{_DW_TABLA}} WHERE _dw_carga_id = {{_DW_CARGA_ID}} AND amount > 10000

In this example, the step only executes if there is any row with an amount greater than 10,000.

Available variables

All pipeline steps can use variables within their SQL fields. They are referenced with the {{NAME}} syntax and are substituted before executing the SQL.

VariableDescription
{{_DW_CARGA_ID}}ID of the current upload
{{_DW_TABLA}}Full name of the dynamic table (e.g., `mmaker_dw`.`dw_1_sales`)
{{_DW_BLOQUE_ID}}Bloque ID
{{_DW_FICHERO}}Name of the uploaded file
{{_DW_PARENT_CARGA_ID}}ID of the parent upload (only in BPM actions linked to another upload)
{{_DW_ESTADO_BPM}}Current BPM state of the upload (updated after estado type steps)
{{ESTADO}}Internal pipeline state: starts as ok, becomes error if something fails
{{field_name}}Value of the upload field with that name (filled by the user)
{{step_variable}}Variable captured by a previous variable type step
Tip: You can use variables inside other variables. For example, a variable step in fixed mode can have variable_valor = "Report for {{period}} - {{client}} ({{total_rows}} rows)", combining upload field values.

The {{ESTADO}} variable

The {{ESTADO}} variable is an internal indicator that reflects whether the pipeline has had problems:

  • Starts with value ok.
  • Changes to error if a validacion_stop step fires (finds problematic rows).
  • Changes to error if a SQL execution fails.
  • Shared between the parent pipeline and nested triggers.

You can use {{ESTADO}} in transitions to branch the flow based on whether there were errors.

User message (mensaje_usuario)

Validation steps (validacion_stop and validacion_alarma) can have a mensaje_usuario template. This template generates human-readable messages from the SQL result rows.

The template uses {{column}} to substitute values from each SQL result row:

Row {{line}} has product "{{product}}" with negative amount ({{amount}})

If mensaje_usuario is not defined, the system looks for a MSG column in the SQL result. If that doesn't exist either, a JSON dump of the row is shown.

Step types

validacion_stop — Validation with rollback

The most critical pipeline step. Executes a SQL query and, if it returns rows, the validation is considered failed. All upload data is deleted (complete rollback: DELETE of inserted rows + reversal of any SQL executed previously in the pipeline).

sql_code
SQL query that searches for problematic rows. If it returns at least one row, validation fails. If it returns no rows, validation passes and the pipeline continues.
SELECT _dw_linea AS line, product, amount
FROM {{_DW_TABLA}}
WHERE _dw_carga_id = {{_DW_CARGA_ID}}
  AND amount < 0
mensaje_usuario
Template to generate readable messages for each problematic row. Uses {{column}} to insert SQL result values.
Line {{line}}: product "{{product}}" has negative amount ({{amount}})

Error message hierarchy:

  1. If mensaje_usuario is defined → the template is applied to each row.
  2. If not, and the SQL has a MSG column → that column's value is used.
  3. If neither → a JSON dump of each row is shown.
Warning: The rollback is total. Not only is the upload data deleted, but any INSERT, UPDATE, or DELETE executed by previous steps in the same pipeline is also undone. This is possible because the entire pipeline runs within a transaction.

Effect on {{ESTADO}}: If validation fails, {{ESTADO}} changes to error.

validacion_alarma — Validation without rollback

Works the same as validacion_stop regarding SQL and messages, but with a fundamental difference: it does NOT rollback. Data is kept and the upload completes. Problematic rows are shown as warnings to the user.

sql_code
Same logic as validacion_stop. Query that searches for suspicious rows.
mensaje_usuario
Same template as validacion_stop for readable messages.

Warnings are shown in the preview modal after confirming the upload, alongside the results table (if any). The user sees the data but is informed about the issues.

Typical use case: Detecting rows with unusual values (e.g., amounts above a threshold, future dates, unknown codes) that are not serious errors but deserve review.

sql — SQL execution

Executes a SQL query directly against the mmaker_dw database. Can be any DML operation: INSERT, UPDATE, DELETE, or even CREATE INDEX.

sql_code
SQL query to execute. The number of affected rows is logged.
UPDATE {{_DW_TABLA}}
SET amount_eur = amount * exchange_rate
WHERE _dw_carga_id = {{_DW_CARGA_ID}}

The step result (affected rows) is recorded in the log. If the SQL fails, {{ESTADO}} changes to error and the error is logged, but the pipeline continues with subsequent steps (no automatic rollback — that's what validacion_stop is for).

Common uses:
  • Calculate derived columns (conversions, percentages, classifications).
  • Update summary or aggregate tables.
  • Insert records into other tables (logs, audits, notifications).
  • Delete old or temporary data.

variable — Variable capture

Captures a value and makes it available as a variable for subsequent pipeline steps. Has two operating modes:

SQL mode

Executes a SQL query and converts the first row's columns into variables. Each column becomes a variable with the column's name.

sql_code
Query that returns the values to capture.
SELECT COUNT(*) AS total_rows,
       SUM(amount) AS total_amount,
       MAX(date) AS most_recent_date
FROM {{_DW_TABLA}}
WHERE _dw_carga_id = {{_DW_CARGA_ID}}

After this step, the variables {{total_rows}}, {{total_amount}}, and {{most_recent_date}} are available in all subsequent steps.

Note: Only the first row of the result is used. If the query returns multiple rows, the rest are ignored. If it returns no rows, the variables are not created.

Fixed mode

Assigns a literal value directly, without executing SQL.

variable_nombre
Name of the variable to create (e.g., report_title).
variable_valor
Literal value to assign. Can reference other variables with {{...}}.
Report for {{period}} - {{client}} ({{total_rows}} rows)

After this step, {{report_title}} contains the text with all variables substituted.

Tip: Fixed mode is useful for composing text from multiple variables, or for assigning constant values that will be used in later steps (such as email recipients, filenames, etc.).

Variable persistence

All captured variables (both SQL and fixed mode) are saved in the dw_pipeline_variables table linked to the upload. This allows:

  • Viewing captured values in the upload history.
  • Displaying information on Kanban cards (via bricks).
  • Auditing what values were used in each pipeline execution.

mailing — Email sending

Sends emails with dynamically generated attachments from a SQL query. Requires the company to have SMTP configured in dw_mail_config.

sql_contenido
Important: Mailing uses the sql_contenido field, NOT sql_code. This query generates the data used for both the email body and attachment files.
SELECT c.email AS DESTINO,
       c.name AS client_name,
       s.date, s.product, s.amount,
       CONCAT(c.name, '_', DATE_FORMAT(s.date, '%Y%m')) AS ADJUNTO
FROM {{_DW_TABLA}} s
JOIN `mmaker_dw`.`dw_1_clients` c ON c.id = s.client_id
WHERE s._dw_carga_id = {{_DW_CARGA_ID}}

Special columns in the SQL

ColumnRequiredDescription
DESTINOYesRecipient email address(es). Can be a single email or multiple separated by comma (ana@company.com,pedro@company.com).
ADJUNTONoGrouping key. All rows with the same ADJUNTO value are grouped into a single attachment file. Each distinct value generates a separate file. If this column doesn't exist, all rows go into one attachment.
FORMATONocsv or excel. Determines the attachment file format. Defaults to excel if not present.
ELEMENTNoAdditional variable available for substitution in the email subject and body. Useful for personalizing the message with row data.
mail_titulo
Email subject. Supports variables: {{ADJUNTO}}, {{ELEMENT}}, and any pipeline variable.
Sales report - {{ADJUNTO}} - {{period}}
mail_cuerpo
HTML email body. Same substitutions as the subject.
<h2>Sales Report</h2>
<p>Attached is the sales report for {{ADJUNTO}}.</p>
<p>Period: {{period}}</p>
<p>Total rows processed: {{total_rows}}</p>

How the sending process works

  1. sql_contenido is executed to obtain the data.
  2. Rows are grouped by the ADJUNTO value (if the column exists).
  3. For each group, an attachment file is generated (Excel XML 2003 or CSV per FORMATO) with the data columns (excluding the special columns DESTINO, ADJUNTO, FORMATO, ELEMENT).
  4. Unique email addresses are collected from the DESTINO column for that group.
  5. The email is sent with the attachment to all recipients in the group.
  6. The send is logged in dw_mail_log.
Requirement: The company must have SMTP configured in the Mail Config section of the pipeline. Without SMTP configuration, the mailing step will fail.
Practical example: With the SQL above, if there are 3 clients (Ana, Pedro, Luis), each with a distinct ADJUNTO value (e.g., "Ana_202604", "Pedro_202604", "Luis_202604"), 3 emails will be sent: each with an Excel file containing only that client's sales rows.

trigger — Call another pipeline

Executes another complete pipeline within the current one. It's like a "function call": the referenced pipeline runs inline, sharing the context (variables, upload, transaction).

trigger_pipeline_id
ID of the pipeline to execute. Selected from a list of available pipelines in the company.

Detailed behavior

AspectBehavior
VariablesShared bidirectionally. Parent variables are available in the trigger, and variables created in the trigger are available in the parent after returning.
validacion_stopIf a validacion_stop fires inside the trigger, it aborts everything: the trigger and the parent pipeline. Complete rollback.
FIN transitionA transition pointing to NULL (end of pipeline) inside the trigger only ends the trigger. The parent pipeline continues with its next step.
{{ESTADO}}Shared. If the trigger fails, the parent sees {{ESTADO}} = 'error'.
DepthMaximum 5 nesting levels (trigger within trigger within trigger...). If exceeded, the step fails with an error.
LogLog messages from the trigger are prefixed with the trigger pipeline name to distinguish them from the parent.
Use case: Reuse common validation or transformation logic across multiple pipelines. For example, a "Common Validations" pipeline that checks date formats, product codes, etc., called from multiple upload pipelines.

bucle — Loop (iteration)

Executes a set of embedded SQLs for each row of a main query's result. Useful for operations that require row-by-row processing.

sql_code
Main loop query. Each result row is one iteration.
SELECT DISTINCT client_id, client_name
FROM {{_DW_TABLA}}
WHERE _dw_carga_id = {{_DW_CARGA_ID}}
bucle_pasos
JSON array of embedded SQLs executed per row. Each element has nombre (descriptive name) and sql (the query to execute).
[
  {
    "nombre": "Update totals",
    "sql": "UPDATE `mmaker_dw`.`dw_1_client_summary` SET total = (SELECT SUM(amount) FROM {{_DW_TABLA}} WHERE client_id = '{{client_id}}') WHERE id = '{{client_id}}'"
  },
  {
    "nombre": "Log activity",
    "sql": "INSERT INTO `mmaker_dw`.`dw_1_activity_log` (client_id, action, date) VALUES ('{{client_id}}', 'upload_updated', NOW())"
  }
]

Detailed behavior

  • Columns from each result row of sql_code become temporary variables (e.g., {{client_id}}, {{client_name}}).
  • General pipeline variables remain available within the loop.
  • After each iteration, temporary variables are restored to their original values (they don't contaminate the next iteration or the parent pipeline).
  • If an embedded SQL fails, {{ESTADO}} changes to error and is logged, but the loop continues with subsequent iterations.
  • The log shows: Bucle[0].Update totals: 1 row(s) affected.
Performance: Loops execute one SQL per iteration, which can be slow with many rows. If possible, consider using a single SQL step with UPDATE ... JOIN or INSERT ... SELECT instead of a loop. Reserve loops for operations that truly require row-by-row processing.

tabla — Results table

Generates a data table displayed to the user in the interface. Does not modify data — only serves to display information.

sql_code
Query that generates the data to display.
SELECT product, SUM(amount) AS total_amount, COUNT(*) AS num_rows
FROM {{_DW_TABLA}}
WHERE _dw_carga_id = {{_DW_CARGA_ID}}
GROUP BY product
ORDER BY total_amount DESC

The result is saved in the upload log (dw_carga_log) with tipo = 'tabla' and displayed in two places:

  • Post-upload: In the preview modal after confirming, alongside alarm warnings (if any).
  • Upload detail: In the history view, "Results tables" section above the execution log.

If there are multiple tabla steps in the pipeline, the tables are shown stacked (one below the other), each with its title (the step name).

Use case: Show a summary of what was loaded (totals by product, counts by category, top 10 records...) so the user can visually verify the data is correct.

flyout — File generation

Generates an Excel or CSV file from a SQL query. The file can be downloaded from the interface or sent directly to an FTP/SFTP server.

sql_code
Query that generates the file data.
SELECT product, date, amount, client_name
FROM {{_DW_TABLA}} t
JOIN `mmaker_dw`.`dw_1_clients` c ON c.id = t.client_id
WHERE t._dw_carga_id = {{_DW_CARGA_ID}}
ORDER BY date, product
flyout_formato
excel (Excel XML 2003 format, .xls extension) or csv (plain text, semicolon-separated).
flyout_nombre
Generated filename. Supports {{...}} variables for dynamic names.
Sales_{{period}}_{{client}}.xls
flyout_destino
  • descarga — File is saved in uploads/flyouts/ and available for download from the upload detail in the UI.
  • ftp — File is automatically sent to a configured FTP/SFTP server.
flyout_ftp_id
Only if flyout_destino = ftp. Reference to the FTP/SFTP configuration in dw_ftp_config (selected from a dropdown in the UI).

The generated file record is saved in dw_flyout_log with information about name, format, destination, status, and row count.

Security: Flyout files in uploads/flyouts/ are not directly accessible via URL. They can only be downloaded through the get_flyout endpoint, which verifies resource ownership before serving the file.

estado — BPM state change

Changes the BPM state (estado_bpm) of an upload. Used in pipelines linked to Kanban actions and state transitions.

estado_valor
State value to assign. Can be a literal text or use {{...}} variables for dynamic value.
Approved

Or with a variable:

{{new_state}}

Behavior by context

SituationBehavior
Upload has parent_carga_idSets estado_bpm on the parent upload, not the current one.
Upload does NOT have parent_carga_idSets estado_bpm on the current upload.

After assignment, the {{_DW_ESTADO_BPM}} variable is updated immediately, so subsequent pipeline steps already see the new state.

Use case: In a Kanban, the transition from "Pending" to "Approved" executes a pipeline containing an estado step with estado_valor = Approved. This updates the upload and moves the card on the board.

Transitions between steps

Transitions control the pipeline's execution flow, creating a decision tree instead of a linear sequence. Each step can have multiple transitions with different conditions.

Transition types

TypeConditionDescription
siempreNoneAlways triggers, no condition. Equivalent to an unconditional jump.
hay_filasSQL resultTriggers if the current step returned rows in its result (applies to validations, SQL variables, etc.).
sin_filasSQL resultTriggers if the current step returned NO rows.
valor_igualVariableTriggers if the specified variable (variable_name) has a value equal to valor_esperado.
valor_diferenteVariableTriggers if the variable has a value different from valor_esperado.
valor_mayorVariableTriggers if the variable is numerically greater than valor_esperado.
valor_menorVariableTriggers if the variable is numerically less than valor_esperado.
valor_mayor_igualVariableTriggers if the variable is greater than or equal to valor_esperado.
valor_menor_igualVariableTriggers if the variable is less than or equal to valor_esperado.
restoFallbackTriggers only if no other transition from the same step matched. Acts as an "else" or "default".

Transition properties

paso_origen_id
The step from which the transition originates (set automatically when creating the transition from a step).
paso_destino_id
The step to jump to if the condition is met. If NULL, indicates end of pipeline — execution stops here.
tipo
Condition type (see table above).
variable_name
Only for valor_* types. Name of the variable whose value is evaluated (e.g., total_rows, ESTADO).
valor_esperado
Only for valor_* types. Value to compare the variable against.
orden
Evaluation order. Transitions are evaluated in ascending order and the first match is used.

Evaluation rules

  1. After executing a step, its transitions are looked up ordered by orden.
  2. Each condition is evaluated in sequence.
  3. The first transition whose condition is met determines the next step.
  4. If no condition is met and a resto transition exists, that one is used.
  5. If no transitions are defined (or none match and there's no resto), execution continues to the next step by orden.

Decision tree example

Step 1: variable (SQL) → captures {{total_rows}}
   ├── valor_mayor total_rows > 1000 → Step 4 (high volume alert)
   ├── valor_igual total_rows = 0    → NULL (end: no data)
   └── resto                         → Step 2 (normal flow)

Step 2: validacion_stop → check duplicates
   ├── hay_filas   → NULL (end: automatic rollback)
   └── sin_filas   → Step 3

Step 3: sql → calculate totals
   └── siempre     → Step 5

Step 4: validacion_alarma → warn high volume
   └── siempre     → Step 2

Step 5: mailing → send summary
   (no transitions → end of pipeline)

UI configuration

Step editor

Steps are managed from the Structure tab of the pipeline (or legacy bloque). Each step is shown as a card with its type, name, and an active/inactive indicator.

Creating a step

Use the "Add step" button below the step list. A form opens with the fields corresponding to the selected step type. The visible fields change based on the chosen type.

Deactivating a step

A step can be deactivated without deleting it (activo field). An inactive step is skipped during execution but preserved in the configuration so it can be reactivated later.

Transition editor

Each step has a button to manage its transitions. Clicking it shows the transition editor where you can add, modify, and delete transitions. It shows the destination step (or "END" to terminate the pipeline), the condition type, and comparison values.

Reordering steps

The orden field determines the base sequence. Steps can be reordered by dragging. The order matters when there are no transitions: the system follows the next step by numeric order.

Warning: When deleting a step, all its transitions (both incoming and outgoing) are deleted in cascade. If other steps had transitions pointing to the deleted step, those transitions are lost. Review the flow after deleting a step.

BPM / Kanban

The {M}aker BPM (Business Process Management) system allows you to manage workflows over data loads (cargas) using a visual Kanban board. Each DW bloque can have its own board with configurable states, controlled transitions, and invocable actions on existing loads.

Key concept: A data load is not just a processed file: it can represent an order, a request, a production batch, or any business entity. The BPM system lets you manage its full lifecycle with states, transitions, and automated actions.

Overview

The BPM system consists of four main elements:

States
Stages that a load goes through (e.g., "Pending", "Under review", "Approved", "Rejected"). Configured per bloque.
Kanban board
Visual view with columns = states and cards = loads. Cards are draggable between columns.
Transitions
Rules that define which movements are allowed between states, and which pipeline (if any) executes on the move.
Actions
Pipelines that can be manually invoked on existing loads. They allow executing logic (mailing, triggers, state changes) without creating new data.

Kanban states

States define the stages of the process. They are configured in the Kanban tab of the bloque, using the "Configurar" (Configure) button.

State properties

PropertyDescription
Name Free text identifying the state. Appears as the column title on the board. Example: "Pending", "In progress", "Completed".
Color Hex color for the board column (e.g., #3b82f6 for blue). Each state has its own color for quick visual differentiation.
Is initial If checked, newly confirmed loads in this bloque automatically receive this state. Only one state should be initial. If no initial state exists, new loads don't enter the Kanban.
Is final Marks the state as a terminal state. Informational: does not block movements but visually indicates that the load has completed its lifecycle.
Order Column position on the board, from left to right. States are sorted from lowest to highest order.
Automatic initial state: When confirming a load in a bloque that has Kanban states with es_inicial = 1, the system automatically assigns that state to the new load (via setInitialEstadoBpm). This guarantees every new load enters the board in the correct column without manual intervention.

Renaming states

When renaming an existing state, the system automatically reassigns all loads that had the old name to the new name. This is managed via the renombramientos array sent on save: each entry indicates {de: "old_name", a: "new_name"}.

Warning: If you delete a state that has assigned loads, those loads will have an estado_bpm that doesn't match any configured state. They won't appear on the Kanban board. Use reassignments to move loads to another state before deleting.

Reassignments

When saving state configuration, you can include reassignments to move loads from one state to another. Each reassignment indicates {de: "source_state", a: "target_state"}. This is useful when deleting a state and wanting to redistribute its loads.

Kanban board

The board is displayed in the Kanban tab of the bloque. It presents a column view where:

  • Each column represents a configured state, with its color and name as header.
  • Each card represents a load with that estado_bpm.
  • Cards are draggable (drag & drop) between columns.
  • Each column header shows the count of cards it contains.

Card configuration (Bricks)

Kanban cards display configurable information via bricks. Bricks are configured in the "Configurar" button of the Kanban, under the "Tarjetas" (Cards) tab.

Each brick references a variable captured during pipeline execution (stored in dw_pipeline_variables) or a campo_carga value. Bricks have three possible roles:

RoleDescriptionQuantity
Header (cabecera) Main title of the card. Displayed in bold at the top. Typically the file name, an identifier, or a significant field. One variable
Detail (detalle) Card subtitle. Displayed below the header in smaller text. Could be a date, a responsible user, etc. One or more variables
Brick Informational chips in the card body. Each shows a label and the variable's value, with configurable color. Ideal for showing metrics, amounts, categories. Multiple
Available variables: The variable selector for bricks shows all distinct variables captured by the pipelines of the bloque's loads. If a pipeline generates variables like total_rows, total_amount, or client, they appear available for brick configuration. Campo_carga values are also available.

Card configuration example

Header:  client          --> "Acme Corp"
Detail:  order_date      --> "2026-03-15"
Brick:   total_amount    --> [Amount: 12,500.00]
Brick:   line_count      --> [Lines: 48]
Brick:   priority        --> [Priority: High]

Transitions

Transitions define which movements are allowed between states on the Kanban board. They are configured in the "Configurar" button of the Kanban, under the "Transiciones" (Transitions) tab.

Transition properties

PropertyDescription
Source state State from which the card is allowed to move.
Target state State to which the card is allowed to move.
Pipeline (optional) Pipeline that executes automatically when the transition occurs. If not configured, the state change is direct.
Undefined movements: If no transition is configured for a source-target pair, the movement is blocked. The card cannot be dragged to that column. You must explicitly configure each allowed movement.

Transitions with pipeline

When a transition has an associated pipeline:

  1. The user drags the card to the target column.
  2. The system verifies the transition exists.
  3. The associated pipeline executes (which typically includes a estado step to change the estado_bpm).
  4. If the pipeline fails or a validacion_stop triggers, the card does not move and stays in its original column.
  5. If the pipeline completes successfully, the card reflects the new state.
Recommended pattern: The transition pipeline should include at least one estado step that assigns the target state. It can also include validations (verify conditions before allowing the change), mailings (notify the responsible person), triggers (execute additional logic), or any combination of steps.

Actions on loads

Actions allow executing pipelines on existing loads without uploading a new file. They are configured in the Acciones (Actions) tab of the bloque.

Action properties

PropertyDescription
Name Descriptive text for the action (e.g., "Approve order", "Send notification", "Reject with reason").
Icon Emoji or character that visually identifies the action in buttons (e.g., ▶).
Pipeline Pipeline executed when the action is invoked. Typically a pipeline without a table (only executes steps).
Source state If configured, the action is only visible when the load is in this state. If NULL, the action is available in any state.

Executing actions

Actions appear as buttons in the load detail (in the Cargas tab of the bloque) and in the portal history. When clicked:

  1. A modal opens with the campos_carga (upload fields) of the action's pipeline (if any). This allows the user to enter additional data (e.g., rejection reason, comment, date).
  2. Upon confirmation, the pipeline executes on the existing load (executePipelineAction).
  3. The pipeline has access to the original load's variables: {{_DW_CARGA_ID}}, {{_DW_TABLA}}, {{_DW_BLOQUE_ID}}.
  4. The variable {{_DW_PARENT_CARGA_ID}} is available to reference the parent load.
  5. Results (logs, tables, errors) are shown after execution.
State filtering: If an action has estado_origen = "Pending", it will only appear for loads whose estado_bpm is "Pending". When the load moves to another state, the button disappears. Use estado_origen = NULL for actions that should always be available.

Pipelines without table

Pipelines with an empty nombre_tabla (nullable) are pipelines that only execute steps without inserting data into a dynamic table. They are ideal for BPM actions:

  • State change: an estado step that updates the estado_bpm.
  • Notifications: a mailing step that sends an email.
  • Chained logic: a trigger step that invokes another pipeline.
  • Validations: a validacion_stop step that verifies conditions before allowing a transition.

To create a pipeline without a table, enable the "Sin fichero" (No file) toggle in step 1 of the pipeline wizard. The pipeline will not create a target table in the DW database.

The "estado" step type

The estado step type is a pipeline step designed specifically for BPM. It allows changing the estado_bpm of a load.

Properties

estado_valor
Value of the state to assign. Can be a fixed text (e.g., Approved) or an expression with variables (e.g., {{new_state}}) for dynamic values based on prior pipeline logic.

Behavior

  • If the load has parent_carga_id (it's the result of an action), the state is assigned to the parent load.
  • If the load has no parent, the state is assigned to the load itself.
  • After assignment, the variable {{_DW_ESTADO_BPM}} is updated immediately and is available for subsequent pipeline steps.
Typical example: An "Approve" transition pipeline contains: 1) validacion_stop that verifies the amount doesn't exceed a limit, 2) estado step with estado_valor = "Approved", 3) mailing step that notifies the requester. If validation fails, the state doesn't change and the email is not sent.

Parent-child relationship between loads

When an action is executed on a load, a child load is created linked via parent_carga_id. This allows:

  • Tracking which actions have been executed on an original load.
  • The estado step type to write the new state to the parent load (the original), not the child load (the action).
  • Viewing the complete history of actions executed on a load via the carga_hijas endpoint.

Step-by-step configuration

1. Create states

  1. Select the bloque in the sidebar.
  2. Go to the Kanban tab.
  3. Click "Configurar" (Configure).
  4. In the "Estados" (States) tab, add states with name, color, and order.
  5. Mark one as initial so new loads automatically enter the Kanban.
  6. Save the configuration.

2. Configure cards

  1. In the same configuration window, go to the "Tarjetas" (Cards) tab.
  2. Select a variable as header (card title).
  3. Optionally, select variables as detail (subtitle).
  4. Add bricks with the variables you want to show as chips, with label and color.
  5. Save the configuration.

3. Define transitions

  1. In the "Transiciones" (Transitions) tab, define each allowed movement.
  2. For each transition, indicate source state, target state, and (optionally) pipeline to execute.
  3. Save the configuration.

4. Create actions (optional)

  1. Go to the Acciones (Actions) tab of the bloque.
  2. Click "Nueva accion" (New action).
  3. Configure name, icon, pipeline (typically without table), and source state (if you want to filter by state).
  4. Save the action.
Requirement: For actions and transitions to work correctly, the referenced pipelines must exist and be properly configured. Verify that transition pipelines include estado steps if you want them to change the estado_bpm automatically.

Scheduled execution

{M}aker allows automating pipeline execution through two mechanisms: schedules (cron-based programmed executions) and radars (FTP/SFTP folder watchers). Both are configured per bloque and run automatically via the scheduler.php script.

System requirement: For scheduled execution to work, the scheduler.php script must be configured as a system cron job running every minute: * * * * * php /path/to/mmaker/scheduler.php

Schedules (programmed execution)

A schedule executes a pipeline automatically at a frequency defined by a cron expression, without needing to upload a file. Ideal for recurring processes that don't depend on new file data (consolidations, periodic calculations, report dispatching).

Configuration

Schedules are managed in the "Programados" (Scheduled) tab of the bloque. Each schedule has the following properties:

PropertyDescription
Name Unique identifier for the schedule within the company. Appears in logs and UI cards.
Description Optional free text to document the schedule's purpose.
Cron expression Standard 5-field cron expression: minute hour day_of_month month day_of_week. Defines execution frequency. See the "Cron expressions" section below.
Field values Default values for the pipeline's campos_carga (upload fields), excluding type file. These values are used automatically on each execution without user intervention.
Active Toggle on/off. If deactivated, the schedule won't execute even when its time arrives.

Cron expressions

The cron expression uses the standard 5-field format:

*    *    *    *    *
|    |    |    |    |
|    |    |    |    +-- day of week (0-7, 0 and 7 = Sunday)
|    |    |    +------- month (1-12)
|    |    +------------ day of month (1-31)
|    +----------------- hour (0-23)
+---------------------- minute (0-59)

The interface offers presets for the most common expressions:

PresetExpressionMeaning
Every hour0 * * * *At minute 0 of every hour
Daily 8am0 8 * * *Every day at 8:00
Monday 8am0 8 * * 1Every Monday at 8:00
Mon-Fri 8am0 8 * * 1-5Monday to Friday at 8:00
1st of month0 8 1 * *First day of each month at 8:00
Every 5 min*/5 * * * *Every 5 minutes
Manual execution: Each schedule has an "Ejecutar" (Execute) button that launches an immediate execution, without waiting for the next scheduled time. Useful for testing the configuration or forcing a one-off run.

Internal operation

  1. The scheduler.php script runs every minute.
  2. It selects all active schedules whose proxima_ejecucion is less than or equal to the current time.
  3. For each schedule, it executes executeNoFilePipeline(), which creates a load with nombre_fichero = '[programado] schedule_name' and runs the pipeline associated with the bloque.
  4. After execution, it automatically recalculates proxima_ejecucion using the cron parser.
  5. It logs the result in dw_scheduler_log with status, duration, and generated load.

UI cards

Each schedule is displayed as a card with:

  • Name of the schedule.
  • Human-readable cron: the cron expression translated to text (e.g., "Monday to Friday at 8:00").
  • Status badge: ok (green), error (red), or procesando (yellow) from the last execution.
  • Next execution: calculated date and time of the next run.
  • Buttons: Execute (manual run), Edit, Activate/Deactivate, Delete.

Radars (folder watchers)

A radar watches an FTP or SFTP folder to detect new files and process them automatically. Ideal for integrations with systems that deposit files on a server (ERP, banks, suppliers).

Configuration

Radars are managed in the "Radares" (Radars) tab of the bloque. Each radar has the following properties:

PropertyDescription
Name Unique identifier for the radar within the company.
Description Optional free text.
Source type ftp -- references an existing FTP/SFTP configuration (see "FTP/SFTP configuration" section).
FTP configuration Selector of the previously configured FTP/SFTP destination (only visible when type = ftp).
Remote path Directory within the FTP/SFTP server to scan for files. Default: /.
File pattern Glob pattern to filter files. Examples: *.xlsx (all Excel files), sales_*.csv (CSVs starting with "sales_"), * (all). Default: *.
Interval (min) Polling frequency in minutes. Minimum 1 minute. The radar only scans if at least this many minutes have passed since the last check.
Field values Default values for campos_carga, same as in schedules.
Move processed If enabled, after successfully processing a file it's moved to a procesados/ subfolder (or the path specified in ruta_procesados) on the FTP/SFTP server. If not, the file stays in place (and could be reprocessed in the next cycle).
Processed path Custom path where processed files are moved. If not specified, procesados/ relative to the radar's path is used.
Active Toggle on/off.
Move processed: If you disable "Move processed", the radar will find the same files on every cycle and reprocess them. This can cause duplicate data if the pipeline doesn't have singularity keys configured. It's recommended to always enable this option.

Internal operation

  1. The scheduler.php script checks active radars whose ultima_revision + intervalo_min has expired.
  2. It scans the remote folder with scanFtpFiles(), filtering by patron_fichero.
  3. For each file found:
    1. Downloads the file temporarily (downloadFtpFile()).
    2. Executes the complete load flow: parsing, singularity delete, insert, pipeline.
    3. If mover_procesados is enabled and the load was successful, moves the file to the subfolder.
  4. Logs each processed file in dw_scheduler_log.
"Probar" (Test) button: Each radar has a "Probar" button that scans the folder and shows found files without processing them. Useful for verifying that the connection, path, and pattern are correct before activating the radar.

UI cards

Each radar is displayed as a card with:

  • FTP badge indicating the connection type.
  • Pattern: configured file pattern.
  • Interval: polling frequency.
  • Status badge: ok, error, or sin_ficheros (no files) from the last check.
  • Buttons: Test (scan without processing), Edit, Activate/Deactivate, Delete.

FTP/SFTP configuration

FTP/SFTP destinations are configured at the company level and can be used by both radars and flyout pipeline steps. They are managed from the pipeline panel, FTP/SFTP section.

FTP configuration properties

PropertyDescription
Name Unique identifier within the company. Appears in radar and flyout selectors.
Protocol ftp (standard FTP) or sftp (SSH File Transfer Protocol, more secure).
Host Server address (IP or domain). Example: ftp.company.com.
Port Connection port. Default: 21 for FTP, 22 for SFTP.
Username Username for authentication.
Password Password. Only updated when a new value is sent (current value is not shown for security).
Destination path Base directory on the server. Default: /.
Passive mode FTP only: enables passive mode (PASV). Recommended when firewalls are involved. Enabled by default.
Connection test: Each FTP configuration has a "Test" button that attempts to connect to the server and lists the contents of the configured directory. Useful for verifying credentials and accessibility before using the configuration in radars or flyouts.
SFTP: SFTP connections require the ssh2 PHP extension to be enabled. If not available, the system will show a clear error indicating the extension is needed. Standard FTP does not require additional extensions.

SMTP configuration (mailing)

For mailing pipeline steps to send emails, the company's SMTP server must be configured. This is done in the administration panel, "Mail" section.

SMTP configuration properties

PropertyDescription
SMTP Host SMTP server. Example: smtp.gmail.com, smtp.office365.com.
SMTP Port Server port. Typical values: 587 (TLS), 465 (SSL), 25 (no encryption).
SMTP Username Email or username for SMTP authentication.
SMTP Password SMTP account password. Only updated when a new value is sent.
Sender email "From" address on sent emails.
Sender name Name displayed alongside the sender email (optional).
Encryption tls (recommended), ssl, or none (no encryption, not recommended).
Send test: The "Test" button sends a test email to the specified address (or to the sender email if none is given). Verify the SMTP configuration is correct before using it in production pipelines.

Scheduler log

All executions (schedules and radars) are logged in dw_scheduler_log with:

  • Type: schedule or radar.
  • File: name of the processed file (radars only).
  • Status: ok, error, or sin_ficheros (no files).
  • Message: result or error detail.
  • Duration: execution time in seconds.
  • Load: reference to the generated load (if any).

The log is accessible from the UI in the detail of each schedule or radar, showing the last 20 executions.

User portal

The portal is a simplified interface designed for end users (usuario role). It allows uploading files, checking load status, and reviewing history, without access to {M}aker's technical configuration.

Automatic redirect: Users with the usuario role are automatically redirected to the portal when they access {M}aker's main URL (index.php). They do not have access to the configuration interface (queries, reports, packs, pipelines).

Access and permissions

Portal users only see the resources (apps and bloques) for which they have explicit permission. The administrator configures these permissions from {M}aker's main interface.

Access axes

There are two ways to grant access to a user:

App permission
The user receives access to an entire app (tipo_recurso = dw_app). This gives them access to all bloques within that app. If new bloques are added to the app, the user sees them automatically. Ideal for users who need broad access to a functional area.
Bloque permission
The user receives access to a specific bloque (tipo_recurso = dw_bloque). They can only view and upload data to that particular bloque. Ideal for users with responsibility over a specific data type.
Permission combination: The two axes are cumulative. A user can have access to an app (all its bloques) and also direct access to bloques from other apps. The portal shows the union of all accessible resources.

Configuring permissions (from the main interface)

Permissions are managed from {M}aker's Administration section (accessible only to admin and superadmin roles):

  1. Go to the user administration section.
  2. Select the user you want to grant access to.
  3. In the permissions section, add resources:
    • dw_app: access to an app and all its bloques.
    • dw_bloque: access to a specific bloque.
    • report: access to a report (for other contexts outside the portal).
    • pack: access to a pack (for other contexts outside the portal).
  4. Save the permissions.

The admin_guardar_permisos endpoint replaces all user permissions at once (it's not incremental: send the complete desired list).

Portal interface

The portal has a clean, modern interface with the following sections:

Search bar

At the top, a search bar allows filtering visible apps and bloques by name. Filters in real time as the user types.

Apps and bloques view

The main screen shows accessible apps, each as an expandable card containing its bloques. Each bloque has an "Subir" (Upload) button that starts the upload flow.

If the user has direct access to bloques that don't belong to any app (or whose app is not in their permissions), these are shown in a separate section.

Recent activity

Feed of the user's most recent loads across all accessible bloques. Shows:

  • Uploaded file name.
  • Target bloque.
  • Load status (ok, error, procesando).
  • Date and time.
  • Number of processed rows.

Per-bloque history

Detailed view of all loads for a bloque, accessible from each bloque's history button. Shows:

  • List of loads with status, file, date, ok/error rows.
  • Detail of each load: execution log, per-row errors, result tables.
  • "Acciones" (Actions) button (if the bloque has BPM actions configured) -- see next section.

Upload flow

The upload flow in the portal is identical to {M}aker's main interface, including the field groups system.

Flow with field groups

If the bloque's pipeline has campo_carga groups configured, the upload modal is presented as a multi-step wizard:

  1. Group 1: The first visible group's fields are shown. The user fills in the values and clicks "Continuar" (Continue).
  2. Condition evaluation: When advancing, the system evaluates the next group's condition:
    • siempre (always): the group is always shown.
    • valor_igual / valor_diferente: the group is shown only if a previous field has (or doesn't have) a specific value.
    • sql: the server evaluates a SQL query to decide whether to show the group.
  3. Group N: The process repeats for each visible group.
  4. Summary: Before selecting the file, a summary of all filled values is shown. The user can go back to correct.
  5. File: The user selects the file and clicks "Continuar" to see the preview.
  6. Preview: The first parsed rows are shown according to the pipeline configuration.
  7. Confirm: The user confirms the load. Singularity delete, insert, and pipeline are executed.

Flow without groups (legacy)

If no groups are configured, all campos_carga and the file selector are shown in a single step, followed by preview and confirmation.

SQL select fields: Fields of type select whose options are defined with a SQL query (SQL:SELECT...) are dynamically reloaded when navigating between groups. If the SQL query contains {{field}}, the referenced field's value is automatically substituted, enabling dependent selects (e.g., a "Category" field that filters the options of a "Subcategory" field).

Upload without file

If the pipeline is configured as "Sin fichero" (no file / pipeline without table), the flow skips file selection and preview. The user only fills in the campos_carga and confirms. This is useful for actions like registering manual data or executing processes that don't require an input file.

BPM actions in the portal

If a bloque has configured actions (Actions tab in the main interface), portal users can execute them from the history view.

How they work

  1. In a bloque's load history, each entry with available actions shows an "Acciones" (Actions) button in the top-right corner.
  2. When clicked, the list of available actions expands, filtered by the load's current estado_bpm.
  3. The user selects an action.
  4. If the action's pipeline has campos_carga, a modal opens to fill them in.
  5. Upon confirmation, the pipeline executes on the existing load.
  6. The result (success, error, result tables) is shown to the user.
Action visibility: Actions with a configured estado_origen only appear when the load is in that state. If the load has no estado_bpm (no Kanban configured), only actions without estado_origen (those with NULL) are shown. If the bloque has no configured actions, the "Acciones" button does not appear.

Differences between portal and main interface

FeatureMain interface ({M}aker)Portal
Access superadmin, admin, desarrollador roles usuario role
Configuration Full: queries, reports, packs, pipelines, bloques, apps, Kanban, actions None: operation only (upload, view status)
Data upload Same flow with full wizard Same flow with full wizard
Kanban Full board with drag & drop, state and transition configuration Not available (actions from history only)
BPM Actions From load detail and Kanban board From load history
Table data "Datos" tab with paginated table and SQL console Not available
Administration User, company, permission management Not available

Independent session

The portal has its own authentication system (portal/auth.php), independent from {M}aker's main session. This means:

  • The portal login is a separate screen with its own form.
  • Portal and main interface sessions are independent.
  • Rate limiting (5 attempts per IP in 15 minutes) applies equally to the portal.
  • Session cookies are HttpOnly and SameSite=Strict for security.

Quick guide for administrators

To enable the portal for an end user:

  1. Create the user with the usuario role in the Administration section.
  2. Assign permissions to the user:
    • dw_app permission for access to a complete app, or
    • dw_bloque permission for access to individual bloques.
  3. Share the portal URL with the user (/mmaker/portal/).
  4. The user logs in with their credentials and sees only the assigned resources.
Typical model: A consulting firm creates a project (child company), configures bloques with pipelines and Kanban, then creates users with the usuario role for the client. The client accesses the portal, uploads their data, and can execute actions (like "Approve" or "Reject") from the history. The consulting firm's technical team monitors the process from the main interface using the Kanban board.

Public Forms

Public forms allow you to expose a bloque's campos_carga (upload fields) as a public web form accessible without login, similar to Google Forms or Typeform. Anyone with the link can fill in the form and submit data that gets processed through the bloque's pipeline.

Typical use case: An internal team configures a bloque with upload fields (name, email, file attachment...) and shares the public URL with external clients or suppliers. Submitted data enters the bloque's pipeline directly without the external user needing a {M}aker account.

Enabling a public form

  1. Navigate to the bloque in the DW section of the sidebar.
  2. Open the Vista (View) tab in the bloque panel.
  3. Toggle "Formulario publico" (Public Form) on.
  4. The system automatically generates a unique URL with a token of the form frm_xxxxxxxxxxxxxxxx.
  5. Copy the URL using the copy button or use "Abrir" (Open) to preview the form.
Tip: Before sharing the URL, open the form yourself to verify that fields, groups, and validations render correctly. The public form renders exactly the same upload fields that a portal user would see.

Configuration options

When the public form is enabled, two configurable options appear:

Max submissions/hour per user
Limits the number of submissions per hour from the same browser. Identification is based on an anonymous fingerprint (hash of IP + User-Agent). Default value: 10 submissions/hour. Useful for preventing abuse or accidental duplicate submissions.
File size limit (MB)
Maximum allowed size for file attachments uploaded from the form. Default value: 5 MB. Applies per individual file, not to the total submission. Files exceeding this limit are rejected with a clear error message.

External user experience

When a user accesses the public form URL, they see a clean, responsive interface with a light theme, designed for intuitive use:

Form without groups (classic)

If the pipeline has no field groups configured, all fields are shown on a single screen. The user fills in the fields, attaches files if needed, and clicks Submit.

Form with groups (multi-step wizard)

If the pipeline has field groups, the form is presented as a step-by-step wizard:

  1. Step 1: Fields from the first visible group are shown (based on conditions).
  2. The user fills in and clicks Continue.
  3. Intermediate steps: The next group's condition is evaluated. If visible, it's displayed; otherwise, it's skipped.
  4. Summary: Final screen showing all entered values. The user reviews and confirms.
  5. Submission: The pipeline executes (same flow as executeNoFilePipeline).

Visual wizard elements:

  • Progress dots: visual indicators of the current step out of the total.
  • Progress bar: horizontal bar that advances with each step.
  • Back/Continue buttons: smooth navigation between steps.

Result after submission

After submitting the form, the user sees:

  • Result tables if the pipeline generates tabla type steps.
  • Warnings if the pipeline has validacion_alarma type validations.
  • Generic success message if the pipeline generates neither tables nor warnings.
  • A "Submit another" button to return to a clean form for another submission.
Warning: If the pipeline has a validacion_stop that triggers, a full rollback occurs and the user sees an explanatory error message. Make sure your validation messages (mensaje_usuario) are well-written for an external audience.

Supported field types

Type Rendering Notes
input Free text field Simple single-line text
number Numeric field Client-side numeric format validation
select Dropdown CSV options (Jan,Feb,Mar) or SQL query (SQL:SELECT...)
date Date picker Native browser date format
file File picker Size and extension validation

Selects with SQL options

Select fields with SQL options (SQL:SELECT...) are resolved in two ways:

Without {{field}} variables
Options are pre-resolved server-side when loading the form. The dropdown renders directly with all options.
With {{field}} variables (dependent)
Options are loaded dynamically via AJAX when the user changes the value of the field they depend on. The dropdown updates in real time. This enables cascading selects (e.g., select country then cities load for that country).

Anonymous user

Uploads generated by public forms are attributed to a system user anonimo@sistema automatically created per company. This user:

  • Cannot log in to {M}aker or the portal.
  • Exists solely as a reference for anonymous uploads.
  • Is created once per company the first time a submission is received.
  • Uploads from this user appear in the bloque's history like any other upload, identified by the name anonimo@sistema.

Security

Public forms implement several layers of protection:

Measure Detail
Rate limiting Configurable submission limit per hour per fingerprint (IP + User-Agent). Exceeding the limit returns a clear error.
File size limit Configurable maximum size per file attachment. Validated both client-side and server-side.
Extension whitelist Only safe file extensions are accepted. Executable extensions (.exe, .bat, .php, etc.) are rejected.
No session / no CSRF The public form requires no user session or CSRF token. Authentication is based solely on the frm_xxx token in the URL.
Unique token Each form has a unique random token. Disabling the toggle invalidates the token.
Important: Anyone with the URL can submit data. Do not share the URL in public channels if the form accepts sensitive information. If you suspect a URL has been compromised, disable the form and re-enable it to generate a new token.

Full technical flow

  1. The user accesses the URL with token frm_xxx.
  2. The server validates the token and loads the bloque configuration and its effective pipeline.
  3. Upload fields are rendered (with groups if configured).
  4. The user fills in fields and attaches files.
  5. Rate limiting is validated (fingerprint vs configured limit).
  6. Files are validated (size, extension).
  7. executeNoFilePipeline executes with the form values, attributed to anonimo@sistema.
  8. The pipeline processes the data: fixed columns with campo_carga_ref are populated, rows are inserted, steps execute.
  9. The result is returned (tables, warnings, or success message).
Pipeline without table: Public forms work with both pipelines that have a destination table and pipelines without a table (that only execute steps). In the latter case, no data is inserted into any dynamic table; the pipeline simply executes its steps (send emails, change states, execute triggers, etc.).

Administration

The administration panel allows managing companies, projects, and system users. It requires an admin or superadmin role to access.

Access: The administration section is available from the gear icon in the topbar. It is only visible to users with the admin or superadmin role.

Company hierarchy (consultancy model)

{M}aker organizes companies in a two-level hierarchy that reflects the typical model of a consultancy with projects:

Parent company (top-level)
The main entity with parent_id = NULL. Represents the consultancy or main organization. Resources created here are considered general resources and are accessible from all child projects.
Project (child company)
A company with parent_id pointing to the parent company. Represents a specific client or project. Resources created here are isolated: only visible from that project.

Example structure:

Company "Consultancy ABC" (parent_id=NULL)
  |-- Admin: ana@consultancy.com
  |-- Project "Client Acme" (parent_id=1)
  |     |-- Developer: dev@consultancy.com
  |     +-- User: contact@acme.com (portal only)
  +-- Project "Client Beta" (parent_id=1)
        +-- Developer: other-dev@consultancy.com

Project color

Each project has an automatically assigned color from a palette of 10 colors. This color is used throughout the interface to visually identify which project each resource belongs to:

  • Colored dots in the sidebar next to resources from a specific project.
  • Grey "G" badge for general resources (from the parent company) when viewing a specific project.

Project selector

The dropdown in the topbar allows filtering the entire interface by project. It is the main mechanism for cross-cutting scoping:

Selection What is visible Where new resources are created
"All" Resources from all accessible companies In the parent company (general)
Specific project Project resources + parent company general resources In that project
Isolation rule: Resources from one project are not accessible from another project. Only general resources (from the parent company) are visible from any child project. This ensures that one client's data does not mix with another's.

Visual badges in the sidebar

"All" view
General resources (parent company) have no badge. Project resources have a colored dot with the project's color and a tooltip with its name.
Specific project view
Resources from the selected project have no badge. General resources have a grey "G" badge to distinguish them.
Note: The selector only appears if the user has access to more than one project. If there is only one company, the selector is not shown.

User management

System roles

Role Primary access Admin access Scope
superadmin Entire system Companies, all users, everything Global
admin Their company + child projects Create projects, manage users in their scope Company + children
desarrollador Full UI ({M}aker) None Assigned company
usuario Portal only None Permitted resources
Automatic redirect: Users with the usuario role are automatically redirected to the portal when logging in via index.php. They cannot access the {M}aker configuration UI.

Creating a user

  1. Go to the Admin section from the topbar.
  2. In the Users tab, click "New user".
  3. Fill in the fields:
    • Email: must be unique across the entire system.
    • Name: display name in the interface.
    • Password: initial password.
    • Role: select the appropriate role.
    • Company: company/project the user belongs to.
  4. Click Create.

Managing existing users

Edit
Modify the user's name, email, or role. Role changes take effect immediately.
Toggle active/inactive
Deactivating a user immediately kills all their active sessions. The user will be unable to log in until reactivated.
Reset password
Sets a new password and invalidates all active sessions. The user must log in again with the new password.
Caution: Deactivating a user or resetting their password immediately closes all their sessions. If the user is currently working, they will lose their session without prior warning.

Permission management

Permissions control which resources a user with the usuario role can see in the portal. The desarrollador, admin, and superadmin roles have full access to resources in their scope without needing explicit permissions.

Resource types with permissions

Type Permission effect
report The user can see the report in the portal
pack The user can see the pack in the portal
dw_bloque The user can upload files and view history for the bloque in the portal
dw_app The user can access the app and all its bloques in the portal (inheritance)

Dual-axis access (apps/bloques)

Access to bloques from the portal works with a dual axis:

  • App axis: If permission is granted to an app, the user inherits access to all bloques within that app.
  • Bloque axis: Permission can be granted to an individual bloque without granting access to the entire app.
Tip: Use app permissions for users who need access to all bloques in a functional area. Use individual bloque permissions for more granular access.

Assigning permissions

  1. In the Admin section, select a user.
  2. In their detail view, go to Permissions.
  3. Select the resources (apps, bloques, reports, packs) you want to assign.
  4. Save. Changes take effect immediately.

API keys

Each user can have a unique API key for authentication from external integrations:

Format
sk-mmaker-xxxxxxxxxxxxxxxx
Usage
Sent as a header Authorization: Bearer sk-mmaker-xxx in HTTP requests.
Compatible integrations
  • MCP Server: the {M}aker MCP server uses the API key to authenticate against api.php.
  • Excel Add-in: the Excel add-in uses the API key to upload data and query tables.
Security
Requests with Bearer auth skip CSRF validation (no session or cookies). The API key identifies the user and their company, applying the same access rules as a normal session.
Important: The API key grants full access as if the user had logged in. Do not share it and treat it as a password. If compromised, generate a new one from the admin panel.

Company management

Creating a company/project

  1. In the Admin section, Companies tab.
  2. Click "New company".
  3. Enter the name. The slug is generated automatically if left blank (URL-safe format: lowercase, no spaces or accents).
  4. If created by an admin (not superadmin), the company is created as a child project under the admin's company.

Deactivating a company

The active/inactive toggle deactivates the company. Users from that company will be unable to log in. The company's resources continue to exist but are not accessible.

Note on deletion: Companies are not deleted, only deactivated. This preserves referential integrity of historical data (uploads, queries, reports, etc.).

Rate limiting (login)

The system protects against brute force attacks on login:

  • 5 failed attempts per IP in 15 minutes = temporary block.
  • Generic message: "Too many attempts. Please wait a few minutes."
  • After a successful login, attempts for that IP are cleared.
  • Old records (>1 hour) are cleaned up probabilistically (1% of requests).
  • Applies to both the main login and the portal login.

Power BI Integration

{M}aker connects to Power BI in two ways: via an HTTP launcher (recommended) that requires no MySQL driver, or via a direct MySQL connection (legacy). Additionally, the DW system offers a data API for accessing dynamic tables and named queries directly from Power Query.

Recommended method: The HTTP launcher is the preferred method. It requires no driver installation, does not need MySQL exposed externally, and works with both Power BI Desktop and the Power BI service (cloud).

Method 1: HTTP Launcher (recommended)

The HTTP launcher is a Power Query M function called mmaker() that downloads each query's code from the server via Web.Contents and executes it with Expression.Evaluate.

How it works

  1. Power BI invokes mmaker("query_name", true, true).
  2. The launcher function makes an HTTP call to the codigo_m_report endpoint with the report token and query name.
  3. The server resolves the version, substitutes {{PARAM}} with configured values, and returns M code as plain text.
  4. Power BI executes the code with Expression.Evaluate(Response, #shared).

Step-by-step setup

  1. In {M}aker, select the report in the sidebar.
  2. Open the "Lanzadora" (Launcher) tab.
  3. Copy the M code block shown (the complete mmaker function).
  4. In Power BI Desktop, create a blank query (Home > Get Data > Blank Query).
  5. Open the Advanced Editor and paste the launcher code.
  6. Name this query mmaker.
  7. To consume a query, create another blank query with: mmaker("query_name", true, true).
Tip: The mmaker function appears in Power BI as an invocable function with dropdowns for the Version and Evaluar parameters, thanks to the Documentation.AllowedValues metadata.

Launcher parameters

Parameter Type Values Description
NombreQuery text Query name Exact name of the query in {M}aker
Version logical true / false true = active version (published); false = draft (development)
Evaluar logical true / false true = execute M code; false = show code as text (debug)
Config nullable record Optional record (see below) Optional. Groups staging injections (fields Source, SourceA, SourceB...) and step sampling (field Paso).
Debug mode: Invoking with mmaker("query", true, false) returns the M code as text without executing it. Useful for diagnosing errors: you can see exactly what code is being generated, with parameters already substituted.

The Config record

The fourth parameter accepts a record combining two things: the stagings injected into the evaluation environment and the Paso for sampling. All fields are optional.

// Valid examples:
mmaker("calendar", true, true)                                     // no config
mmaker("sales", true, true, [Source = SalesRaw])                   // with staging
mmaker("report", true, true, [SourceA = Sales, SourceB = Clients]) // multi-staging
mmaker("sales", true, true, [Paso = "Types"])                      // sampling
mmaker("sales", true, true, [Source = SalesRaw, Paso = "Types"])   // combined

Any field starting with Source is injected into the Expression.Evaluate environment with that name (the transform M code references it as if it were a local variable). The Paso field activates sampling mode.

Export step sample (Emulator)

Passing the Paso field in Config extracts data from an intermediate step to feed the {M}aker emulator:

mmaker("Sales_Raw", true, true, [Paso = "Headers"])

This returns a table with the first 50 rows of the "Headers" step. Internally, the server generates M code that runs the query up to that step and serializes the result as JSON, which the launcher parses back into a table.

To use the result in the emulator:

  1. In Power BI, invoke the function with the fourth parameter.
  2. Copy the resulting JSON (or export the table).
  3. In {M}aker, in the Steps view of the query, click "Paste JSON".
  4. Paste the JSON and select the emulator start step.
When to use this: Especially useful for queries connecting to databases, APIs, or SharePoint — sources the emulator cannot simulate. Exporting a sample from an intermediate step lets you emulate subsequent steps without a real connection.

Multi-token (parameter RLS)

A report can have multiple tokens, each with its own parameter values. This enables Row-Level Security by parameter scenarios:

  • Each token accesses the same queries but with different {{PARAM}} values.
  • Example: Token "Spain" with {{COUNTRY}} = "ES", Token "France" with {{COUNTRY}} = "FR".
  • Each Power BI user receives a launcher with their specific token.
  • Tokens are managed from the report's "Accesos" (Access) tab.

Query types and PBI Service refresh

{M}aker classifies queries into three types based on their content, which determines how they're consumed from Power BI:

TypeBadgeContentUsageService refresh
transform T Pure M transformations (Table.*, List.*, Text.*, etc.) — no connectors Invoked via mmaker("name", true, true) Yes
staging S Contains connectors (Excel.Workbook, SharePoint.Files, Sql.Database, Web.Contents...) Pasted LITERAL as a separate query in the .pbix. Its output is injected into a transform's mmaker Config Yes (staging is native M code in the .pbix)
completa C Entire query with connectors, quick & dirty Invoked via mmaker("name", true, true), but the .pbix must have the Desktop variant of mmaker pasted (same name, body uses #shared) No (PBI Service flags "dynamic data source")

Why connectors can't go inside mmaker

The mmaker launcher passes a curated _env record (~430 pure transformation functions) to Expression.Evaluate, instead of #shared. This is what enables refresh in PBI Service: without connectors in the environment, the service analyzer treats it as a static data source.

If you put Excel.Workbook(...) inside a transform query, refresh would fail with "the name 'Excel.Workbook' cannot be found", because it's not in _env. That's why queries with connectors live as tipo=staging and the connector runs outside Expression.Evaluate (natively in the .pbix).

Automatic division: from original query to staging + transform

When you paste a query with connectors into {M}aker (via "Paste M code" or via the AI assistant), the system detects connectors and proposes automatic division:

  1. Paste complete code, including SharePoint.Files + Excel.Workbook + subsequent transformations.
  2. {M}aker detects connectors and shows a preview: "Will create staging X with N steps + transform with M steps".
  3. Confirm: {M}aker extracts connector steps (and their pure navigation like Book{[Item="Sheet",Kind="Sheet"]}[Data]) into a new tipo=staging query, named {queryName}Conn by default. The original query keeps the pure post-frontier steps and its references are rewritten to the Source alias.
  4. In the report's Access tab you now see two blocks: the staging M code (to paste in .pbix) and the invocation mmaker("name", true, true, [Source = nameConn]).
Shared stagings: one staging can be used by multiple transforms (e.g. sales_by_month and sales_top10 both consume salesConn). In the Access tab each staging appears only once even if used by N transforms — paste the staging code into the .pbix and that's it.

Power BI flow step by step

Imagine a query sales_2026 originally with SharePoint + Excel + transformations, automatically split by {M}aker into:

  • sales_2026Conn (staging type, with SharePoint.Files + Excel.Workbook)
  • sales_2026 (transform type, with Table.PromoteHeaders + Table.TransformColumnTypes, starts with Source)

In Power BI Desktop you paste three queries:

// 1. The launcher (copy from report "Access" tab, SERVICE variant)
mmaker = let Token = "mk_...", RootUrl = "...", ApiPath = "..." in ...

// 2. The staging (copy from "Access" > "Required stagings")
sales_2026Conn = let
    Source = SharePoint.Files("https://tenant.sharepoint.com/sites/X", [ApiVersion = 15]),
    File = Source{[Name="sales.xlsx"]}[Content],
    Book = Excel.Workbook(File, null, true),
    Sheet = Book{[Item="Sales",Kind="Sheet"]}[Data]
in Sheet

// 3. The final query (what you'll use in the model)
sales_2026 = mmaker("sales_2026", true, true, [Source = sales_2026Conn])

Server-side changes in sales_2026 (adding calculated columns, new types, filters) are picked up on the next refresh without touching the .pbix. You only need to regenerate the staging if the SharePoint URL or file name changes.

Desktop variant of mmaker (body with #shared)

The Access tab also offers a Desktop variant of the launcher: same function name (mmaker), only the body differs — it uses #shared as environment instead of the curated _env. It supports any query with connectors directly, but the dataset blocks scheduled refresh in Service. Useful for:

  • Rapid development (not splitting queries every time)
  • Reports only used in Desktop
  • Queries marked as tipo=completa (quick & dirty)

Because both variants share the same name, invocations like mmaker("X", true, true) work with whichever variant is pasted — the .pbix decides which one serves the call. Switching from Desktop to Service is as simple as re-pasting the body in the same mmaker query.

// The invocation is identical regardless of which variant is pasted:
mmaker("my_query_with_excel", true, true)

Alternative pattern: Desktop + OneDrive (unofficial)

Note: This pattern is not part of the official {M}aker product. It's a community alternative useful in specific scenarios (single customer, few reports, no Premium or gateway). Documented here as reference for consultants, but official support is for the methods above.

When a customer has a single environment with several .pbix files linked to {M}aker and doesn't want to deal with staging/transform discipline or pay for Power BI Premium, there's a known alternative that leverages the Service's OneDrive auto-refresh:

  1. An always-on machine (mini-PC, VM, or office workstation) with Power BI Desktop installed and data source credentials configured.
  2. Task Scheduler + PowerShell opens the .pbix, forces refresh, saves, and closes — at whatever cadence you need.
  3. The .pbix lives in a folder synced with OneDrive / SharePoint.
  4. Power BI Service detects the change (~1h polling) and imports the snapshot: model, queries AND already-refreshed data.

In this scenario you can use the Desktop variant of mmaker (with #shared) for all your queries, without needing to split into staging/transform. Connectors (Excel, SharePoint, SQL, Web.Contents...) work directly because Desktop handles the refresh locally, not Service.

Full {M}aker experience: server-side query changes (adding steps, new columns, adjusting types) are picked up on the next scheduled Desktop refresh, without touching the .pbix or redistributing anything. Versioning, draft/active, per-token params, and emulator still work as usual.

PowerShell refresh script

Power BI Desktop doesn't expose an official CLI for refresh, but it can be automated via SendKeys from PowerShell:

param(
    [Parameter(Mandatory=$true)][string]$PbixPath,
    [int]$WaitLoadSec = 60,      # time to open the .pbix
    [int]$WaitRefreshSec = 600   # refresh timeout (adjust to size)
)

Add-Type -AssemblyName System.Windows.Forms
$pbi = "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"

# 1. Open the .pbix
$proc = Start-Process -FilePath $pbi -ArgumentList "`"$PbixPath`"" -PassThru
Start-Sleep -Seconds $WaitLoadSec

# 2. Focus the window
$title = [IO.Path]::GetFileNameWithoutExtension($PbixPath)
$shell = New-Object -ComObject WScript.Shell
$shell.AppActivate("$title - Power BI Desktop") | Out-Null
Start-Sleep -Seconds 2

# 3. Refresh (Ctrl+Shift+F5 = Refresh All)
[System.Windows.Forms.SendKeys]::SendWait("^+{F5}")
Start-Sleep -Seconds $WaitRefreshSec

# 4. Save
$shell.AppActivate("$title - Power BI Desktop") | Out-Null
[System.Windows.Forms.SendKeys]::SendWait("^s")
Start-Sleep -Seconds 15

# 5. Close
[System.Windows.Forms.SendKeys]::SendWait("%{F4}")
Start-Sleep -Seconds 5
if (!$proc.HasExited) { $proc | Stop-Process -Force }

Save as refresh-pbix.ps1 and schedule in Task Scheduler with:

powershell.exe -File "C:\scripts\refresh-pbix.ps1" -PbixPath "C:\OneDrive\reports\sales.pbix"

When this pattern fits

  • Single customer / tenant with up to ~20 reports.
  • Already uses OneDrive / SharePoint as file repository.
  • Tolerates cumulative latency (Desktop cadence + OneDrive sync + Service caching).
  • Doesn't need DirectQuery or near-real-time.
  • Wants maximum development convenience: connectors anywhere, no staging.

Limitations and caveats

  • Fragility: SendKeys depends on the active window and heuristic timings. If refresh takes longer than the timeout, you save mid-refresh. For serious production, consider Power Automate Desktop (recognizes icons/windows more robustly and detects refresh completion better).
  • Scale: everything goes through one machine. Dozens of large reports saturate the scheduler — everything serializes.
  • Always-on machine: operationally equivalent to an on-prem gateway (Windows, local credentials, maintenance), though architecturally they are different things.
  • Service doesn't orchestrate: no centralized refresh logs, no native alerts if one fails — you have to build those outside.
  • Not multi-tenant: each tenant needs its own machine with its own Desktop and its own credentials.
When NOT to use this pattern: multi-tenant SaaS, scenarios requiring near-real-time, deployments with dozens of tenants, or cases with mandatory DirectQuery. For those, the staging/transform discipline with native Service refresh is the correct path.

Method 2: Direct MySQL (legacy)

This method connects Power BI directly to the MySQL database to read queries and steps.

Requirements: Requires the MySQL ODBC driver installed on the machine and the MySQL server to be accessible from the client's network (localhost, VPN, or exposed port). Not recommended for cloud deployments.

Setup:

  1. Install the MySQL ODBC Connector (version 8.x or higher).
  2. In {M}aker, go to the "Integrar en Power BI" (Integrate with Power BI) panel.
  3. Copy the MySQL launcher M code block.
  4. In Power BI, paste as a blank query.
  5. The launcher reads directly from the queries and query_pasos tables via ODBC.

DW Data API

The DW Data API allows accessing Data Warehouse dynamic tables from Power BI without needing an ODBC driver or exposing MySQL.

Authentication

All DW Data API endpoints use the report token for authentication (the same token as the launcher). The token resolves the user's company and grants access to all DW tables for that company.

Available endpoints

Endpoint Description Usage
dw_tables List company DW tables Metadata: name, row count, columns with types
dw_data Paginated table data Rows as arrays, column metadata, has_more flag for pagination
dw_code Auto-generated M code M code with List.Generate for transparent pagination

Using DW tables from Power BI

  1. In {M}aker, open the report's "Lanzadora" (Launcher) tab (or the token's if using multi-token).
  2. In the "Tablas DW (API)" section, you will see the list of available tables.
  3. Click "Copiar M" (Copy M) next to the desired table.
  4. In Power BI, paste as a blank query. The code already includes:
    • Transparent pagination via List.Generate (automatically handles large tables).
    • Table.TransformColumnTypes with correct column types.
    • Authentication with the report token.
Per_page: By default, the API returns 5000 rows per page (maximum 50000). The List.Generate pagination in the M code handles this transparently: it keeps requesting pages until has_more = false.

DW Named Queries

DW named queries are SQL queries saved on the server, executable via API with a token. They allow creating complex SQL queries that execute server-side and are consumed from Power BI as just another table.

Key features

  • The SQL executes on the server and is not visible in Power BI. The PBI user only sees clean M code with Web.Contents calls.
  • Only SELECT queries are allowed (server-side validation).
  • Support transparent pagination just like DW tables.
  • Can be created from the chat assistant or from the query editor in the UI.

Endpoints

Endpoint Description
dw_sql Executes the named query and returns paginated data
dw_consulta_code Auto-generated M code for the query (with pagination)

Creating a DW query

There are three ways to create DW queries:

From the chat assistant
Ask the assistant to create a query. It automatically uses the crear_consulta_dw tool and generates the corresponding M query.
From the query editor
In the "Add step" dropdown of a query, select "DW (data connection)". Fill in the query name and SQL. The system creates the DW query and the necessary M steps.
From the DW Queries section
Direct management: create, edit, and delete named SQL queries.

Linked DW query in the step editor

When editing a query step that references a DW query (the M code contains action="dw_sql"...consulta="name"), the edit modal automatically shows:

  • The detected query name.
  • An editable SQL textarea (with intellisense).
  • When saving the step, the DW query SQL is saved simultaneously.
Key advantage: The SQL stays on the server. Power BI users do not see the SQL logic or real table names. They only see M code with Web.Contents API calls.

BI Credentials (ODBC credentials)

For direct ODBC connections to the DW database (legacy or advanced scenarios), {M}aker creates read-only MySQL users per company.

User format
mmaker_bi_{empresa_id} (e.g., mmaker_bi_1)
Permissions
SELECT only on the mmaker_dw database. A GRANT SELECT is automatically issued every time a DW table is created or modified.
Management
  • Create: Endpoint crear_bi_credentials. Generates user + random password.
  • Regenerate: Endpoint regenerar_bi_credentials. Changes the existing user's password.
  • View: Endpoint bi_credentials. Returns user and host (password only on create/regenerate).
Isolation: Each company has its own BI user. The user can only SELECT from dw_{empresa_id}_* tables belonging to their company in the mmaker_dw database. It has no access to the system database (mmaker).

Quick reference: which method to choose

Scenario Recommended method
Centralized M queries without driver HTTP Launcher
DW data without exposing MySQL DW Data API (dw_data / dw_sql)
Complex SQL hidden from PBI user DW Named Queries (dw_sql)
Direct MySQL connection (legacy) BI Credentials + ODBC
Single customer, few reports, no gateway (unofficial) Desktop variant + local scheduled refresh + OneDrive
Power BI Service (cloud) HTTP Launcher + DW Data API (only methods without gateway)

Chat Assistant

The chat assistant is a side panel with integrated artificial intelligence in {M}aker. It is connected to the Claude API (Anthropic) with tool_use capability, allowing it to execute actions directly on the system: create queries, modify steps, configure Kanban, execute BPM actions, and more.

Access: Click the chat icon in the topbar to open the side panel. The assistant maintains conversation context throughout the session.

Automatic context

The assistant automatically receives the context of your current session:

Selected query
If you have an active query in the panel, the assistant knows its name, steps, and code. It can modify it directly.
Active report
If you have a report selected, the assistant knows its ID, token, and API URL. It uses this information to generate M code with the correct tokens.
Active bloque/pipeline
If you are in a DW bloque, the assistant knows its configuration, tables, and associated pipeline.
Tip: Select the relevant report and query before talking to the assistant. This way it will have all the necessary context to generate M code with the correct tokens and parameters.

Assistant capabilities

Query management

The assistant can perform all these operations directly:

  • Create queries: Generates complete queries with multiple steps. If the name already exists, it updates the steps as a new version (upsert).
  • Modify steps: Edits the M code of individual steps.
  • Add steps: Adds new steps to an existing query (via draft).
  • Delete steps: Removes steps from the active query.
  • Assign to report: Assigns a query to a report. Assignment is idempotent (if already assigned, it does not fail).
query_id=0: When the assistant creates a query and assigns it to a report in the same conversation, it uses query_id=0 in asignar_query_report. The system automatically substitutes the ID of the just-created query.

DW Named Queries

The assistant follows a specific flow for creating DW data connections:

  1. Create SQL query: Uses the crear_consulta_dw tool to save the SQL on the server. The query uses upsert: if the name exists, it updates the SQL.
  2. Create M query: Generates the Power Query M steps that call dw_sql via Web.Contents with transparent pagination.
  3. Assign to report: Links the query to the active report.
Critical rule: The assistant always uses Web.Contents + the dw_sql API for DW data. It never generates code with Odbc.Query or MySQL.Database(). The SQL stays hidden on the server and the Power BI user only sees clean M code.

BPM / Kanban

The assistant can configure and operate the full BPM system:

Capability Tool Description
Configure Kanban states configurar_kanban Define board states: name, color, initial, final, order
Configure transitions configurar_kanban_transiciones Define allowed movements between states with optional pipeline
Create actions crear_accion_carga Define pipelines that can be invoked on a bloque's uploads
Execute actions ejecutar_accion Execute a pipeline on an existing upload
Move uploads mover_carga_kanban Move an upload between Kanban states
Configure cards configurar_kanban_tarjeta Define which variables to display on Kanban cards

Best practices

Optimal context

For the best results from the assistant:

  • Select the report before asking it to create a DW query. The assistant will use the report's token to generate the M code.
  • Be specific with table and column names. The assistant knows available DW tables but appreciates exact names.
  • Request complete operations: instead of "create a SQL query", say "create a Power Query that shows sales by month for the last year, using the dw_sales table". The assistant will create the SQL query, the M query, and assign it to the report in a single interaction.

Chained operations

The assistant can execute multiple tools in a single response. Typical example:

  1. Creates a DW query with the SQL.
  2. Creates an M query with 3 steps (Data, Table, Result).
  3. Assigns the query to the active report.

All of this happens in a single chat interaction. If a step fails, the assistant reports the error and suggests corrections.

Cascading modifications

When the assistant changes a source or connection step in a query, it automatically reviews all subsequent steps that may be affected and issues all necessary modifications in a single response.

Tip: The assistant is especially useful for creating complex Power Query M queries. Describe in natural language what you need (filters, transformations, joins) and it will generate optimized M code with correctly named and linked steps.

Conversation structure

  • The conversation persists throughout the browser session.
  • The assistant remembers context from previous messages.
  • When switching queries or reports, the context updates automatically.
  • Each tool call is displayed in the chat as an executed action, with its result.

Limitations

  • The assistant cannot upload files or execute DW uploads directly.
  • It does not have access to DW table data (only structure/metadata).
  • Delete operations request confirmation before executing.
  • Chat history does not persist between browser sessions.
AI model: The assistant uses the Claude API from Anthropic. Conversations are processed via chat.php as a proxy, which adds system context and tool definitions before sending to the API.

RLS Distribution — User-filtered Power BI without publishing

{M}aker's RLS (Row-Level Security) mode lets you distribute the same Power BI report to multiple users and have each one see data filtered by their role, without publishing to Power BI Service or setting up gateway, dynamic RLS, or Pro/Premium licenses.

Key idea: each user gets a personal token (mk_u_...) that resolves server-side to a set of parameters. The M launcher uses that token and receives already-filtered data. Everything happens in Power BI Desktop via Web.Contents.

How it works

  1. Admin creates token-roles on the report (e.g. "North", "South") with different {{REGION}} values.
  2. Toggles RLS on in the Access tab → auto-generates the "Mis Reports" App, the "Report PBI" Pipeline and a bloque linked to the report.
  3. Assigns each user to a token-role → generates a personal user_token (mk_u_...).
  4. Admin uploads a .pbit to the bloque (via portal) with the M launcher prepared and a MakerToken parameter.
  5. Each user opens the portal, copies their personal token, downloads the .pbit and opens it in Power BI Desktop.
  6. Power BI asks for the MakerToken parameter value on open — the user pastes their token.
  7. Save as .pbix. On every refresh, the server returns data filtered by the token.

Step-by-step setup (admin)

1. Create token-roles

In the report's Access tab, create one token per parameter combination. Example for a report with {{REGION}}:

  • Token "North Team" → REGION = "North"
  • Token "South Team" → REGION = "South"
  • Token "Management" → REGION = "%" (sees everything)

2. Enable RLS

In the Access tab, turn on the "RLS Distribution" toggle. The system:

  • Creates the "Mis Reports" App (1 per company) if it doesn't exist
  • Creates the shared "Report PBI" Pipeline (no table, fields: comment + .pbit/.pbix file)
  • Creates a bloque linked to the report with report_id pointing to it

3. Assign users

Under each token-role, click "+ Assign" and pick the user. Their personal user_token is generated automatically.

4. Prepare the launcher with parameter

With RLS active, the Launcher tab shows instructions about the MakerToken parameter and generates M code using Token = MakerToken instead of a hardcoded token:

let
    Token   = MakerToken,  // Power BI parameter
    BaseUrl = "https://your-server/mmaker/api.php",
    ...

5. Create the MakerToken parameter in Power BI Desktop (admin only, one time)

This setup is done by the admin once when preparing the file. End users do NOT need to create the parameter — they receive it already defined inside the .pbit.

  1. Open Power BI Desktop with a blank or existing report
  2. Home → Manage parameters → New
  3. Name: MakerToken
  4. Type: Text
  5. Current value: any valid token (e.g. your own as admin) — only used so PBI can execute the report during design
  6. In the Advanced Editor of the mmaker query, paste the M launcher (which references Token = MakerToken)
  7. Design the report with your visuals
  8. File → Save As → type Power BI Template (.pbit)
Key point: when saving as .pbit, Power BI stores the parameter definition but not its value. When a user opens the .pbit, PBI Desktop automatically prompts them for the parameter value in a modal dialog. The user just pastes their personal token there — no further setup required.

6. Upload the .pbit to the bloque

In the portal, open the report's bloque (under the "Mis Reports" App), click Upload version and attach the .pbit. Optionally add a version comment.

For the end user

The user enters the portal and sees the bloque with a "Report" badge. When opening it:

  1. Current version: highlighted card with the latest .pbit and download button
  2. Your access: personal token with Copy button
  3. Connect Power BI: numbered flow instructions
  4. Version history: earlier downloadable versions

User flow (4 steps)

  1. Copy your personal token from the portal (Copy button)
  2. Download the .pbit of the current version
  3. Open the file — Power BI Desktop launches a dialog asking for the MakerToken parameter value. Paste your token and click Load.
  4. Save as .pbix via File → Save As. Your token is stored in the file. On subsequent refreshes it won't be asked again.
The user never touches the Power Query editor. They just open the .pbit, paste the token in the automatic prompt and save. The parameter is already defined inside the template thanks to the admin's work in step 5.

Security and validation

  • The user_token is opaque (mk_u_<40 hex>) — does not expose internal structure
  • Every request to codigo_m_report with a user_token is validated in real time: user active, token-role active, report active
  • Revoking a user (x button in the table) takes effect immediately on the next refresh
  • Each call is logged in report_usage_log with user, query, IP and timestamp

Usage statistics

In the Access tab, the assigned users table shows:

  • Last use: date of the user's last request
  • 30d: number of refreshes in the last 30 days

Advantages over Power BI Service RLS

Aspect Traditional RLS (PBI Service) {M}aker RLS
LicensePro or PremiumFree Power BI Desktop only
GatewayRequired for on-premise DBsNot required (HTTP)
Logic changesRepublish .pbixChange in {M}aker → next refresh
Per-user parametersDAX roles + assignmentsToken-roles in {M}aker
RevocationRemove workspace accessRevoke user-token (immediate)
Usage auditPBI activity logreport_usage_log in {M}aker

RLS in Excel (Power Query reports in Excel workbooks)

If instead of Power BI you distribute reports as .xlsx/.xltx with Power Query, you can also use RLS. Excel doesn't have the automatic prompt .pbit has, but there's a simple convention: a named cell MakerToken.

Workbook preparation (admin / designer)

  1. In a visible sheet, select a cell (e.g. Config!B2)
  2. In the Name Box (top left), type MakerToken and press Enter
  3. In the Power Query editor, define Token reading from that cell:
    Token = Excel.CurrentWorkbook(){[Name="MakerToken"]}[Content]{0}[Column1]
  4. Next to the cell, add a label like "Paste your personal {M}aker token here" to guide the user
  5. Save as .xltx (Excel Template) with the cell empty — opening the template creates a fresh .xlsx for each user

Use for the end user

Two ways to fill the cell:

Option A — Manual

  1. User copies their token from the portal
  2. Opens the template, pastes the token in the MakerToken cell
  3. Refreshes data (Data → Refresh All)
  4. Saves as .xlsx

Option B — With the {M}aker Excel Add-in

The {M}aker Excel Add-in includes an "RLS" tab that shows all the user's personal tokens:

  1. Open the add-in from Excel (top bar → {M}aker add-in)
  2. Go to the RLS tab
  3. Click "Paste in MakerToken" on the token of the report you'll use
  4. The add-in writes the token directly in the cell — one click
If the cell doesn't exist: the add-in asks if you want to create it in the active cell. The designer just needs to indicate in the workbook which cell is MakerToken.

Differences vs Power BI

Power BI (.pbit)Excel
Prompt on openYes, automaticNo — manual cell
Token saved on closeInside .pbixInside .xlsx (sheet)
VisibilityHidden in parametersVisible in the cell (sheet can be hidden)
Client setupPaste in dialogPaste in cell (or add-in)
Important: This system is pseudo-RLS: security lives in the launcher (server), not in the data model. If a user obtains another user's token, they could see that data. For use cases with strict security requirements (regulated data, PII), use traditional RLS in Power BI Service.

Licensing & Limits

All account limits (reports, queries, monthly loads, AI tokens, storage, etc.) resolve live from a central configurable layer. This section explains the model, how to check your usage, and what happens when you reach a limit.

Concepts

Products and tiers

{M}aker combines three products:

  • CODE (always base): Solo · Studio · Agency. Governs M queries, reports, packs, RLS tokens.
  • DATA (add-on): Light · Pro · Scale. Adds DW tables, pipelines, loads, mailings, BPM.
  • FORMS (DATA add-on): Forms Plus · Forms Pro. High-volume public forms.

Limits (tier_limits)

Each tier defines metric-level limits (e.g. reports: 25, storage_gb: 25). A value of -1 means unlimited.

Prices (tier_prices)

Each tier has monthly and annual prices, in public or early_access flavor. Annual ≈ 10 months paid (~17% off).

Per-subscription overrides

A subscription can have individual exceptions: different limits or price from the base tier, with a reason and optional expiration. Used for custom agreements, specific-client trials, or lower caps for early testers.

Resolution cascade

When asking "what's the queries limit for this company?":

  1. Look for active override in subscription_overrides → wins if it exists.
  2. Otherwise → use the value in tier_limits for the current tier.
  3. If the company has no subscription for that product → limit = 0 (blocked).
Legacy grandfathering: companies without any active subscription (none of CODE, DATA, or FORMS) are treated as legacy and skip all enforcement. This prevents pre-existing accounts from sudden lockouts. On creating the first subscription, limits start to apply.

Billing panel (Admin tab)

Admin → Billing shows:

  • Redeem code: input for early-access vouchers.
  • My subscriptions: products, tier, cycle, status, expiration.
  • AI Chat: monthly token quota, progress bar, BYOK configuration.
  • Active exceptions: overrides applied to your account (only shown if any).
  • Current usage: per-metric table (usage / limit / bar).

80% and 95% alerts

When a metric reaches 80% or 95% of its limit, a fixed banner under the topbar shows:

  • Warning icon (⚠ for 80%, ⛔ for 95%).
  • Metric name + current / limit + percentage.
  • View billing button, linking to the tab.
  • Close button (the alert won't reappear in session unless it escalates to danger).

The banner auto-refreshes every 5 minutes.

Behavior at 100%

MetricBehavior
reports, queries, packs, apps, blocks, pipelines, named_queries, projects, devs, portal_users, schedules, ftp_destinations, rls_tokensCreation blocked. HTTP 402 with "Plan limit exceeded".
monthly_loadsNew loads blocked (file, schedule, radar, action). Existing data remains queryable.
mailings_monthPipeline mailing step skipped with warning, pipeline continues.
ai_tokens_monthChat disabled until 1st of next month or BYOK setup.
storage_gb (Light/Pro)Write blocked on mmaker_dw. Read still works.
storage_gb (Scale)Auto overage (€0.50/GB/month), hard cap at +50% of tier.

AI Chat: courtesy vs BYOK

Courtesy quota

Each CODE tier includes monthly courtesy tokens:

  • Solo: 200,000 tokens
  • Studio: 500,000 tokens
  • Agency: 1,000,000 tokens

Resets on the 1st of each calendar month. Not cumulative.

BYOK (Bring Your Own Key)

You can configure your own Anthropic API key instead of using courtesy:

  • No monthly cap — you pay the provider directly.
  • Ideal for heavy use.
  • Setup: Admin → Billing → AI Chat → "Configure BYOK".
  • Key is stored encrypted (AES-256) on your account.
Recommended: Claude Sonnet 4.6. Cheaper models generate M code with more errors. When BYOK is active, courtesy quota is inactive.

Access codes (vouchers)

Superadmins can generate nominative codes from Admin → Licensing → Codes. Types:

  • Free indefinite: active until revoked (early testers, MVPs).
  • Free with duration: active for N months.
  • With custom overrides: raise/lower specific limits (e.g. {"ai_tokens_month": 2000000}).

A code can be:

  • By email: only redeemable by a user with that email (flexible — company is created on redeem).
  • By company: only redeemable by a specific company (rigid).
  • Open: any user with the code can redeem (limited by usos_max).

Redemption

Two paths:

  1. During registration: at register.php, the code is required (no free trial in early access).
  2. From an existing account: Admin → Billing → "Redeem code".

Revocation

Superadmin can revoke a code from Admin → Licensing → Codes. Immediate effect: derived subscription becomes cancelled and the account loses tier limits (falls back to legacy if no other subscriptions).

Management (superadmin)

Admin → Licensing has 5 tabs:

  • Codes: generate, revoke, see redemptions.
  • Subscriptions: view all system subscriptions, manage overrides.
  • Partners: CRUD for Certified/Strategic partners with commission tracking.
  • Limits: edit tier_limits (immediate global changes).
  • Prices: edit tier_prices. Changes reflect on /pricing after reload.

Public pricing page

Available at /mmaker/pricing.php. Live reads from tier_prices and tier_limits. Bilingual ES/EN. CTA links to register.php.

Database (reference)

  • subscriptions: active subscriptions per company and product.
  • tier_limits, tier_prices: editable catalogs.
  • subscription_overrides: individual exceptions.
  • access_codes, access_code_redemptions: vouchers and redemptions.
  • usage_metrics: monthly counters (loads, mails, AI tokens).
  • ai_usage_log: detailed chat call log.
  • byok_config: encrypted BYOK config.
  • lifecycle_events: audit of subscription changes, redemptions, warnings.
  • partners, partner_attributions, partner_commissions: partner program.