Skip to main content

Metamorph run

POST 

/v2/acts/:actorId/runs/:runId/metamorph

deprecated

This endpoint has been deprecated and may be replaced or removed in future versions of the API.

[DEPRECATED] API endpoints related to run of the Actor were moved under new namespace actor-runs.Transforms an Actor run into a run of another Actor with a new input.

This is useful if you want to use another Actor to finish the work of your current Actor run, without the need to create a completely new run and waiting for its finish. For the users of your Actors, the metamorph operation is transparent, they will just see your Actor got the work done.

There is a limit on how many times you can metamorph a single run. You can check the limit in the Actor runtime limits.

Internally, the system stops the Docker container corresponding to the Actor run and starts a new container using a different Docker image. All the default storages are preserved and the new input is stored under the INPUT-METAMORPH-1 key in the same default key-value store.

For more information, see the Actor docs.

Request

Path Parameters

    actorId string required

    Actor ID or a tilde-separated owner's username and Actor name.


    Example: janedoe~my-actor
    runId string required

    Actor run ID.


    Example: 3KH8gEpp4d8uQSe8T

Query Parameters

    targetActorId string required

    ID of a target Actor that the run should be transformed into.


    Example: HDSasDasz78YcAPEB
    build string

    Optional build of the target Actor.

    It can be either a build tag or build number. By default, the run uses the build specified in the default run configuration for the target Actor (typically latest).


    Example: beta

Status 200

Response Headers
    {
    "data": {
    "id": "HG7ML7M8z78YcAPEB",
    "actId": "janedoe~my-actor",
    "userId": "PNWZBd7Z9c746JAnF",
    "startedAt": "2019-11-30T07:34:24.202Z",
    "finishedAt": null,
    "status": "RUNNING",
    "statusMessage": "Actor is running",
    "isStatusMessageTerminal": false,
    "meta": {
    "origin": "WEB",
    "clientIp": "172.234.12.34",
    "userAgent": "Mozilla/5.0 (iPad)"
    },
    "stats": {
    "inputBodyLen": 240,
    "migrationCount": 0,
    "restartCount": 0,
    "resurrectCount": 1,
    "memAvgBytes": 35914228.4,
    "memMaxBytes": 38244352,
    "memCurrentBytes": 0,
    "cpuAvgUsage": 0.00955965,
    "cpuMaxUsage": 3.1546,
    "cpuCurrentUsage": 0,
    "netRxBytes": 2652,
    "netTxBytes": 1338,
    "durationMillis": 26239,
    "runTimeSecs": 26.239,
    "metamorph": 0,
    "computeUnits": 0.0072886
    },
    "options": {
    "build": "latest",
    "timeoutSecs": 300,
    "memoryMbytes": 1024,
    "diskMbytes": 2048
    },
    "buildId": "HG7ML7M8z78YcAPEB",
    "exitCode": 0,
    "generalAccess": "RESTRICTED",
    "defaultKeyValueStoreId": "eJNzqsbPiopwJcgGQ",
    "defaultDatasetId": "wmKPijuyDnPZAPRMk",
    "defaultRequestQueueId": "FL35cSF7jrxr3BY39",
    "metamorphs": [
    {
    "createdAt": "2019-11-30T07:39:24.202Z",
    "actorId": "nspoEjklmnsF2oosD",
    "buildId": "ME6oKecqy5kXDS4KQ",
    "inputKey": "INPUT-METAMORPH-1"
    }
    ],
    "buildNumber": "0.1.10",
    "containerUrl": "https://hfewsyknno9o.runs.apify.com",
    "isContainerServerReady": false,
    "gitBranchName": "master",
    "usage": {
    "ACTOR_COMPUTE_UNITS": 3,
    "DATASET_READS": 4,
    "DATASET_WRITES": 4,
    "KEY_VALUE_STORE_READS": 5,
    "KEY_VALUE_STORE_WRITES": 3,
    "KEY_VALUE_STORE_LISTS": 5,
    "REQUEST_QUEUE_READS": 2,
    "REQUEST_QUEUE_WRITES": 1,
    "DATA_TRANSFER_INTERNAL_GBYTES": 1,
    "DATA_TRANSFER_EXTERNAL_GBYTES?": 3,
    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 34,
    "PROXY_SERPS": 3
    },
    "usageTotalUsd": 0.2654,
    "usageUsd": {
    "ACTOR_COMPUTE_UNITS": 0.072,
    "DATASET_READS": 0.0004,
    "DATASET_WRITES": 0.0002,
    "KEY_VALUE_STORE_READS": 0.0006,
    "KEY_VALUE_STORE_WRITES": 0.002,
    "KEY_VALUE_STORE_LISTS": 0.004,
    "REQUEST_QUEUE_READS": 0.005,
    "REQUEST_QUEUE_WRITES": 0.02,
    "DATA_TRANSFER_INTERNAL_GBYTES": 0.0004,
    "DATA_TRANSFER_EXTERNAL_GBYTES?": 0.0002,
    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0.16,
    "PROXY_SERPS": 0.0006
    }
    }
    }