MDH GROUP · BLOG

Marqentra for Developers: API & CLI Automation for Deployments, Backups and Connectors

Many developers and technical writers know the scenario: new content workflows are uploaded manually, regular exports and backups are run by hand, and connecting product data from PIM or shop is a fragile custom solution.

← All posts

Marqentra for Developers: API & CLI Automation for Deployments, Backups and Connectors

Introduction — When daily routine becomes a stumbling block

Many developers and technical writers know the scenario: new content workflows are uploaded manually, regular exports and backups are run by hand, and the integration of product data from PIM or shop is a fragile in‑house development. For self‑hosted instances, control over data and deployments is also central. This is exactly where Marqentra, with its API & CLI, comes in: they enable automated, reproducible processes around content production, publishing and data integration.

Prerequisites and first steps

Before you build automations, the following basics should be in place:

  • A running Marqentra Self‑Hosted instance and credentials for an API account or a CLI token.
  • A version repository (e.g. Git) for workflow definitions, templates and scripts.
  • A location for artifacts and backups (e.g. internal storage, SFTP or object storage like S3).

Practically, it is advisable to create a short test repository containing: workflow JSON(s), configuration files and deploy scripts. This way you keep changes, reviews and rollbacks under control.

Automatic deployment of workflows via CLI & API

A common use case: automatically rolling out new or updated workflows to the self‑hosted instance as soon as they land in Git.

Pattern: Git → CI → Marqentra

  • Commit to the main branch triggers a CI job (e.g. GitHub Actions, GitLab CI).
  • CI checks the validity of the workflow file (schema check) and runs tests.
  • On success, CI calls the Marqentra CLI or API to deploy the workflow.

Concrete steps in the CI job (pseudo-description):

  • Checkout the repo
  • Schema validation of the workflow definitions
  • marqentra-cli login --token $MARQ_TOKEN --host $MARQ_URL
  • marqentra-cli deploy workflow --file workflows/product-feed.json

Alternatively, the API can be addressed directly: the CI system sends the workflow file via HTTPS to the Marqentra endpoint with an authorization token. Use environment variables for tokens and endpoints, never hardcoded secrets.

Idempotence and versioning

Make deploy operations idempotent: a commit should not produce a duplicate effect. Set version fields in your workflow definitions and check on the server side whether a file already exists in the same version before overwriting. This prevents unwanted rollbacks or duplicate tasks.

Scripting for backups and exports

Backups are especially important for self‑hosted instances — not only content, but also media library, workflow metadata and publication logs. Marqentra API & CLI can be integrated into simple backup pipelines.

Backup patterns

  1. Data export via API/CLI: Regularly export content bundles, media files and metadata.
  2. Compress and encrypt: Package exports and encrypt artifacts (e.g. GPG) before transfer.
  3. Archiving: Store exports in a separate location (S3/bucket, offsite SFTP) and maintain retention rules.

Typical procedure as a cron/CI job:

  • marqentra-cli export all --output /tmp/marq-export-$(date +%F).tar.gz
  • gpg --encrypt --recipient backup@company.example /tmp/marq-export-....tar.gz
  • aws s3 cp /tmp/... s3://company-marqentra-backups/ --storage-class STANDARD_IA

If you do not use an S3 integration, the same pattern can be applied to internal NAS shares or via SFTP. Add monitoring that reports failed exports in time.

Connecting Your Own Data Sources: PIM, Shop and More

Connecting external systems (PIM, shop, CRM) is often the biggest lever for relevant content. Two proven integration approaches:

1) Pull connector (periodic)

A scheduler periodically calls the PIM/shop API, transforms data (mapping to Marqentra schemas) and sends updated items to Marqentra via API/CLI. Advantages: controlled rate limiting, easy to test.

2) Push connector (event-driven)

The shop or PIM sends webhooks on data changes to a small integration service that receives the message, normalizes it and forwards it to Marqentra. Advantage: minimal latency, fewer unnecessary queries.

Practical tips for connectors

  • Use a transformation layer (e.g. simple scripts or a small Node/Python service) for mapping and validation.
  • Implement retry logic and a dead‑letter queue for failing entries.
  • Version mappings separately and test backward compatibility before deployment.

CI/CD Tips for Your Self‑Hosted Instance

Self‑hosting offers control but requires operational discipline. Some best practices:

  • Separate test and production instances. Test deployments automatically before rolling out to production.
  • Automate rollback scenarios: a defined rollback should be triggered for faulty deployments.
  • Use secrets management (e.g. Vault, GitHub Secrets) for API tokens. Create tokens with minimal permissions.
  • Observability: log aggregation and monitoring (CPU, memory, API latency) help keep automated jobs stable.
  • Deployment approvals: use approvals in your CI when critical workflows are changed.

Security, Data Protection and Self‑Hosted Benefits

In self-hosted operation you retain data sovereignty: content, media and user data reside in your infrastructure. Therefore, security checks should be an integral part of automation:

  • Regular rotation of API tokens.
  • Least privilege for service accounts.
  • Encrypted transmission and storage of sensitive exports.

Marqentra allows you to run automation locally while integrating central functions (topic discovery, AI-assisted creation, editorial planning and publishing) into your existing pipelines — without handing data over to third parties.

Practical example: Brief integration flow for product descriptions

A typical flow from a developer's perspective:

  1. PIM sends a webhook to the integration service when a product changes.
  2. The service validates and maps data into the Marqentra workflow format.
  3. CI checks the template and tests AI prompts locally (sandbox) and versions the changes.
  4. marqentra-cli deploy workflow --file updated-product-workflow.json
  5. Marqentra creates content, checks quality and schedules publication.
  6. An export/backup job archives the version together with metadata.

This pattern scales: you can connect multiple sources without manually adjusting central workflows.

Conclusion and call to action

Marqentra API & CLI give developers the tools to automate repetitive tasks, make backups reproducible and securely connect their own data sources — ideal for self-hosted operation where control and data protection are paramount. Start with small, versioned steps: a workflow in the repo, a CI job for deploy and a simple backup cron. From these building blocks robust automation pipelines emerge that save time and reduce errors.

Discover Marqentra and try the demo: https://marqentra.com

Next step

Try Marqentra yourself

Marqentra combines topic discovery, AI-assisted content creation, media management, editorial planning, automatic publishing and analytics in a single central system. The standalone Marqentra software runs on your own webspace or server. Additionally, Marqentra for WordPress is available for WordPress.

Discover Marqentra and try the demo: https://marqentra.com