API reference

Scripting, DevOps and diagnostics activities

JavaScript scripts, Git and run-log entries.

Flow Current 5 min read Updated

JavaScript scripts, Git and run-log entries. This page covers 3 activity types.

git#

Git. Clone, pull, push, commit, and inspect Git repositories (backed by libgit2 — no external git executable required)

Operations: clone, pull, push, fetch, checkout, create_branch, commit, add, status, log, diff, tag. Set with the operation input.

Input Type Required Description
operation string Yes Git operation to perform Allowed values: clone, pull, push, fetch, checkout, create_branch, commit, add, status, log, diff, tag. Default: status.
repoPath string Yes Local filesystem path to the repository working directory (clone: destination path)
repoUrl string Yes [clone] Remote repository URL to clone from Used when operation is clone.
branch string No [clone/pull/push/checkout/create_branch/log] Branch name (checkout/create_branch: the target branch) Used when operation is clone, pull, push, checkout, create_branch, log.
remoteName string No [pull/push/fetch] Remote name (default: origin) Used when operation is pull, push, fetch.
username string No [clone/pull/push/fetch] Username for HTTPS authentication (any non-empty value works alongside a token) Used when operation is clone, pull, push, fetch.
token string No [clone/pull/push/fetch] Personal access token for HTTPS authentication. SSH remotes are not supported. Used when operation is clone, pull, push, fetch. Secret: stored encrypted.
createBranch boolean No [checkout] Create the branch if it does not already exist (default: false) Used when operation is checkout.
startPoint string No [create_branch] Commit/ref the new branch starts from (default: HEAD) Used when operation is create_branch.
switchAfterCreate boolean No [create_branch] Check out the new branch immediately after creating it (default: true) Used when operation is create_branch.
message string Yes [commit] Commit message. [tag] Annotation message — omit for a lightweight tag. Used when operation is commit, tag.
authorName string Yes [commit] Commit author name (required). [tag/pull] Used for the tag/merge signature (default: "Kiwi Flow") Used when operation is commit, tag, pull.
authorEmail string Yes [commit] Commit author email (required). [tag/pull] Used for the tag/merge signature (default: "kiwiflow@local") Used when operation is commit, tag, pull.
stageAll boolean No [commit] Stage all modified/deleted tracked files before committing (default: true) Used when operation is commit.
filePaths array No [add] Specific file paths or patterns to stage (default: all changes, equivalent to "git add .") Used when operation is add.
maxCount number No [log] Maximum number of commits to return (default: 10) Used when operation is log.
diffFrom string No [diff] Base commit/ref to diff from (default: compares the working directory against HEAD) Used when operation is diff.
diffTo string No [diff] Target commit/ref to diff to (default: compares the working directory against HEAD) Used when operation is diff.
tagName string Yes [tag] Name of the tag to create Used when operation is tag.
targetRef string No [tag] Commit/ref to tag (default: HEAD) Used when operation is tag.
force boolean No [push] Force-push, overwriting the remote branch (default: false) Used when operation is push.
recurseSubmodules boolean No [clone] Recursively clone submodules (default: false) Used when operation is clone.
Output Type Description
output.success boolean Whether the operation completed successfully
output.path string [clone] Path to the cloned repository
output.updated boolean [pull] Whether new commits were merged in
output.headCommit string [pull/create_branch/commit] SHA of HEAD after the operation
output.branch string [checkout/create_branch/status] Branch name
output.commitSha string [commit] SHA of the newly created commit
output.stagedCount number [add] Number of files staged
output.isDirty boolean [status] Whether the working tree has uncommitted changes
output.staged array [status] Staged file paths
output.unstaged array [status] Modified-but-unstaged file paths
output.untracked array [status] Untracked file paths
output.commits array [log] List of {sha, message, author, email, date}
output.patch string [diff] Full unified diff text
output.filesChanged number [diff] Number of files changed
output.additions number [diff] Total lines added
output.deletions number [diff] Total lines deleted
output.tagName string [tag] Name of the tag created

Config block example:

json
{
  "inputs": [
    {
      "name": "operation",
      "value": "commit"
    },
    {
      "name": "repoPath",
      "value": "C:/work/myrepo"
    },
    {
      "name": "message",
      "value": "Automated commit"
    },
    {
      "name": "authorName",
      "value": "Kiwi Flow"
    },
    {
      "name": "authorEmail",
      "value": "bot@example.com"
    }
  ]
}

js_script#

JavaScript Script. Execute a sandboxed JavaScript snippet via the Jint engine. Inputs are injected as named variables; write results to the output object.

This activity is configured through its config block (see the example below) rather than through named inputs.

Output Type Description
output.* object Any key written to the output object in the script body becomes a named output

Config block example:

json
{
  "script": {
    "body": "output.result = inputs.value * 2;",
    "timeoutSeconds": 10,
    "memoryLimitMb": 64
  }
}

log#

Log. Write a structured message to this run execution log. The canonical first step of an error-handling chain (see error.* fields resolvable after an onError.goto), but usable anywhere a real log entry — not a notification — is needed.

Input Type Required Description
level string No Log level: info, warn, or error (default: info) Allowed values: info, warn, error. Default: info.
message string Yes The message to log. Inside an error-handling chain, template it from error.* fields, e.g. "{{error.activityId}} failed: {{error.errorMessage}}".
data object No Optional structured payload to attach to the log entry.
Output Type Description
output.message string The logged message
output.level string The log level used
output.loggedAt string UTC timestamp the entry was logged
output.data object The structured payload, if provided

Config block example:

json
{
  "level": "error",
  "message": "{{error.activityId}} failed: {{error.errorMessage}}"
}